Jump to:

23363 Posts in 18124 Topics by 2862 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, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 437 Views
  • tommymato
    Avatar
    Community Member
    6 Posts

    Template not found - I'm lost in the SS folder structure Link to this post

    (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.)

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Template not found - I'm lost in the SS folder structure Link to this post

    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).

  • tommymato
    Avatar
    Community Member
    6 Posts

    Re: Template not found - I'm lost in the SS folder structure Link to this post

    Many thanks for that. It did the trick.

    Tom

    437 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.