Oct 30
Utilizar diferentes plantillas de páginas en función de la carpeta, de un tag, o de un campo personalizado
Movable type Sin comentarios »Solución aportada en el wiki de movable type
Here’s a solution to use a different page template based upon the “Folder” each page is in.
- Copy the contents of the Page archive template into a template module called “Default Page”.
- Create additional template modules for each page template as necessary: News Page, Industry Page, Product/Service Page etc. (assuming that the same page template is used for Product and Service pages in this example)
- Create a folder corresponding to each Page template: News, Industry, Products, Services, etc.
- Update the Page archive template to use the following code:
<mt:setvarblock name="page_folder"><mt:PageFolder><$mt:FolderLabel$></mt:PageFolder></mt:setvarblock> <mt:if name="page_folder" eq="News"> <$mt:include module="News Page"$> <mt:else name="page_folder" eq="Industry"> <$mt:include module="Industry Page"$> <mt:else name="page_folder" like="(Products|Services)"> <$mt:include module="Products/Services Page"$> <mt:else> <$mt:include module="Default Page"$> </mt:if>
- Publish and View
Comentarios recientes