Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

new Page Types not being applied as templates


Go to End


2 Posts   1553 Views

Avatar
bobdobbs

Community Member, 6 Posts

27 October 2009 at 5:08pm

Hi guys.
I'm going through the tutorials, and I'm working with silverstripe 2.3.1.

If I understand tutorial 1 correctly, you can enable a new page type with this flow:

Create NewPageType.php file under code/mysite,
rebuild db,
create new template,
flush cache,
associate the new page type to any given page in the cms

However, when I then request the page for that I've set to have my new page type from my browser, I get the page with the default template.

What am I missing ?

Thanks.

Avatar
baba-papa

Community Member, 279 Posts

28 October 2009 at 9:30am

If the template has the same name as the new Model/Controller file the framework will use it to render the controllers data. The template consitst of two files, eg the Page.php uses the template Page.ss and layout/Page.ss (case sensitive).