Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Template for specific page

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1175 Views
  • hairiemx
    Avatar
    Community Member
    6 Posts

    Template for specific page Link to this post

    How do i use different template for specific page? Is it possible?

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Template for specific page Link to this post

    Do you mean you have a certain page type created, but want to use a template only on one specific page, and not all the pages that use that page type?

    Could use include .ss template files and if statement checks in your template, but that is messy.

    I'd just create a special page type for that specific page and use the $Layout variable in your template.

    That's what the Layout folder is for in your template directory. When you create a page type, say HomePage.php, by default SS will then look into your Layout folder for HomePage.ss and use that as the template, if none exists, it uses the standard page.ss

    Read the tutorials as they explain more on this.

    1175 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.