php - Block defined in page.xml do not render -


i have made custom block in magento contains js. want have placed right after <head> in output html. block looks this:

 <?php if($this->ishomepage()): ?> <script language='javascript1.1' type='text/javascript'>ns_loadingtime1=(new date()).gettime()</script> <?php endif ?> 

in page.xml file of template have this:

 (...) <block type="page/html" name="root" output="tohtml" template="page/2columns-left.phtml">             <block type="baobaz_tags/widget_nedstattag_metadata" name="baobaz_nedstattag_head" as="nedstattaghead" before="head" template="baobaz/tags/widget/nedstattag/homepage/meta.phtml" />             <block type="page/html_head" name="head" as="head"> 

in output html custom block (baobaz_nedstattag_head) don't exists. know can render wish?

edit comment of fabrizio able make right. because in approach getting double entry of block. left page.xml it's written above , have added 1column.phtml $this->getchildhtml('nedstattaghead') before calling head block

you can try move block definition inside head block definition:

<block type="page/html_head" name="head" as="head">      <block type="baobaz_tags/widget_nedstattag_metadata" name="baobaz_nedstattag_head" as="nedstattaghead" template="baobaz/tags/widget/nedstattag/homepage/meta.phtml"  before="-" />   ... missing code of head block definition ... </block> 

make sure add echo $this->getchildhtml('nedstattaghead') in page/html/head.phtml file.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -