Skip to content

Instantly share code, notes, and snippets.

@0-Sony
Last active August 12, 2016 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0-Sony/c075a17edfb5f26c5082 to your computer and use it in GitHub Desktop.
Save 0-Sony/c075a17edfb5f26c5082 to your computer and use it in GitHub Desktop.
Create a new custom Layout page Template which will be visible in back office for page cms
<!-- local/Namespace/Module/etc/config.xml -->
<config>
<global>
<page>
<layouts>
<template_name translate="label" module="Namespace_Module"><!-- Example template_name : homepage -->
<label>Template_Label</label><!-- Example : Homepage -->
<template>path/template.phtml</template>
<layout_handle>handle_name</layout_handle> <!-- Example : namespace_homepage -->
</template_name>
</layouts>
</page>
</global>
<!-- Here we need to update layout with our custom xml -->
<frontend>
<layout>
<updates>
<namespace_module module="Namespace_Module">
<file>namespace_module.xml</file>
</Test_Page>
</updates>
</layout>
</frontend>
</config>
<!-- design/frontend/your_theme/default/layout/namespace_module.xml -->
<handle_name translate="label" module="namespace_module">
<label>Template_Label</label>
<!-- Root -->
<reference name="root">
<action method="setTemplate">
<template>path/template.phtml</template>
</action>
<action method="setIsHandle">
<applied>1</applied>
</action>
</reference>
<!-- Do what you need -->
</handle_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment