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.

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

How to have a page uses one instead of

Go to End

2 Posts   944 Views


Community Member, 143 Posts

18 May 2010 at 2:10pm

I have a file named that resides at root level of templates/ folder. As image below.

All of my pages use that file that contains html tags to form the structure.

Problem is that i need to add an additional <div> tag into only ONE of the pages.

So i dupped to, and added the <div> tag as needed. FIne, but now ALL of my pages shows that <div>, which i dont want, only one of those page.


How do i LINK a particular page to a particular .ss file?????



Community Member, 343 Posts

18 May 2010 at 8:12pm

Edited: 18/05/2010 8:20pm

Well, first you should read the tutorial.

The not-so-nice approach is to simply check the page name in the template:
<% if URLSegment = whateverpageurl %>
<% else %>
<% end_if %>

The better approach is like it's described in the tutorial:
- Create a new page type
- Rebuild Database with /dev/build/?flush
- Reload the CMS and change the page type of this particular page
- Replace '$Content $Form' to '$Layout' in
- Make a new in the Layout folder
- Add '$Content $Form' into Layout/
- Make a new [whateverclassnameyouvechosen].ss in the Layout folder
- Add '<div>$Content $Form</div>' into Layout/[whateverclassnameyouvechosen].ss
- Reload the webpage with ?flush in the end of the URL.