zotonic

How do you set up a page to use a different template in Zotonic?


I would like to have alternative templates for each section of my website.

How do you set up a page to use a different template in Zotonic?


Solution

  • Here is how you could render the about page with a custom template:

    {about,      ["about"], resource_page, [ {template, "about.tpl"}, {id, page_about}]}
    

    If you add the above dispatch rule to your site's dispatch rules (found at yoursite/dispatch/dispatch) it will render a page with the unique name of page_about using about.tpl.

    You can set the unique name for a page in the advanced tab of the page in the zotonic admin.