I want to output a specific child block at a specific place in a template. I am using:

echo $this->getChildHtml('block_name')

Obviously this works.

However, in the same template there is a later call:

echo $this->getChildHtml()

with no parameter

Clearly this outputs the block twice.

Is there any way to avoid this and make the block only possible to output once and still retain the same functionality as above - i.e. output a specific block at a specific place and then all other children later in the template?



| improve this answer | |
  • Where would this go? – Marty Wallace Apr 22 '13 at 21:06
  • In your template file below echo $this->getChildHtml('block_name'). – Dmytro Zavalkin Apr 23 '13 at 7:45

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.