1

I've installed a third party module, and a specific one of it's blocks was not added via the layout file, and was instead just initialised within the template.

I now wish to make a slight layout adjustment to it, so is there a way I can reference this block in my local.xml file, even though it doesn't have a reference name in the same way that a layout enabled blocks does?

3

The short answer is no.

Changes in local.xml are processed during loadLayout, if they are instantiating a block from inside a template, this isn't happening until renderLayout, which occurs after the fact. Depending on the extension / what you are trying to achieve there may be a way around it, such as rewriting the block to inject the behaviour you want.

  • Thanks for this. I'm trying to execute a specific action on the block, but I suppose I can do this in a different place; though it will require modification of the module. – Dan Hanly Mar 5 '15 at 10:39
  • Depending on what the action does, your best bet would probably be to rewrite the block and call it as part of the constructor / whatever method they call in the template. Instantiation of blocks in templates is very annoying in distributed modules, I can't think of a good reason for this to be required (though I'm sure there are some edge cases). – Peter O'Callaghan Mar 5 '15 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.