Search code examples
pyrocms

{{ template:body }} adding the page title


Not sure if this a PyroCMS 2.2.3 bug, but everytime I use {{ template:body }} on my default.html seems that it always add this <h2>Page Title Here</h2>. I already checked on the admin via "Content > Pages > Page types > Edit > Page Content" and I don't see any tags that I placed in there. How can I get rid of it?


Solution

  • This is not a bug. This is how it works. From v2.2 they have changed the page layouts and it works like this.

    Your template files control the main layout of the page (default.php, etc)

    Then at the Pages, you can make use of "page types", each page type can use any of your template files to replace it's contents with {{ template:body }}

    Now, you can write down your page layout via admin panel Pages -> Page types-> Edit -> Layout tab which as default there is a h2 tag for title there.

    <h2>{{ page:title }}</h2>
    {{ body }} 
    

    This gives you the flexibility to use any kind of custom field for any of your page types.

    So, simply edit the layout of the page type you are using and manage how you want to arrange contents via your *page layout*s.

    I hope I could make it clear for you :)