1

I'm trying since hours to get my custom layout handle to work. I have a cms page that calls the layout handle "cms_page_view". Now I want to set in my custom module a new layout handle:

config.xml

<page> <layouts> <cms_page_view module="page"> <label>My Page</label> <template>page/mypage.phtml</template> <layout_handle>cms_page_mypage</layout_handle> </cms_page_view> </layouts> </page> <frontend> <layout> <updates> <custom_mymodule> <file>custom/mypage.xml</file> </custom_mymodule> </updates> </layout> </frontend> 

In my new layout file (custom/mypage.xml):

<?xml version="1.0"?> <layout> <cms_page_mypage translate="label"> <label>MyPage</label> <reference name="root"> <action method="setTemplate"> <template>page/mypage.phtml</template> </action> <action method="setIsHandle"> <applied>1</applied> </action> </reference> <block type="page/html_head" name="head_mypage" as="head_mypage"> <action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action> <action method="addItem"><type>skin_css</type><name>css/styles-ie8.css</name><params/><if>lt IE 9</if></action> <action method="addCss"><stylesheet>css/widgets.css</stylesheet></action> <action method="addCss"><stylesheet>css/print.css</stylesheet><params>media="print"</params></action> </block> </cms_page_mypage> </layout> 

In my cms page in the backend I wrote this in the conent area:

{{block type="core/template" name="my_page" as="content" template="page/html/my_page.phtml"}} 

And in the end ... nothing happens when I call my page/mypage.phtml with this content:

<head> <?php echo $this->getChildHtml('head_mypage') ?> </head> 

What am I missing here???

2
  • instead of 'head_mypage' you call 'my_page' Commented Nov 17, 2015 at 14:33
  • Hi Tipo, did you manage to figure this out? Can you share your solution with us? Commented Dec 17, 2015 at 10:45

1 Answer 1

1

Try putting your "head_mypage" block declaration inside of <reference name="root">

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.