21293 Posts in 5733 Topics by 2602 members
General Questions
SilverStripe Forums » General Questions » Template not found - I'm lost in the SS folder structure
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 220 Views |
-
Template not found - I'm lost in the SS folder structure

23 July 2012 at 10:21pm
(I'm trying to follow the book SilverStripe - The Complete Guide to CMS Development.)
I've added a new page type defined in the php file: public_html\mysite\code\JobCategoryHolder.php
So far, so good. The new page type shows up in the CMS backend. I can create a page based on this type.However, I now need to change the template that matches that page type. The book tells me to create a template called JobCategoryHolder.ss in public_html\themes\mysite\templates\.
That seems to make logical sense. I did that. I then made some small changes to the template (adding a few xxx after the title, etc) just to see if the new template gets picked up. It doesn't.I tried the dev/build/?flush=1 but nothing seems to work. I also tried copying the template to the Layout subfolder. That didn't work either. I'm lost now. I can't get my head around what should be in which folder. Any ideas?
Has the folder structure changed between when the book was written? The book was based on 2.3.3 and I'm using 2.4.7.
Many thanks to the clever person who answers this
Tom
(p.s. I'm very impressed with SS so far - and the book - but occasionally find things in the book that don't match what I'm seeing.)
-
Re: Template not found - I'm lost in the SS folder structure

23 July 2012 at 10:54pm
Make sure your page is selected as a 'JobCategoryHolder' in the CMS. Then visit your page with ?flush=1 appended - yoursite.com/jobs?flush=1 to flush the built in templates. You can use ?showtemplate=1 to see what template SilverStripe is using if you need.
Has the folder structure changed between when the book was written? The book was based on 2.3.3 and I'm using 2.4.7.
Slightly, but yes 2.3 is now quite old. There was an updated book for 2.4 but the general ideas in 2.3 still hold true in 2.4 (unlike 3.0).
-
Re: Template not found - I'm lost in the SS folder structure

24 July 2012 at 9:29pm
Many thanks for that. It did the trick.
Tom
| 220 Views | ||
|
Page:
1
|
Go to Top |


