3393 Posts in 976 Topics by 852 members
|Go to End|
8 September 2011 at 4:32am
I'm trying to organise my mysite/code folder by placing my code in sub directories, however when I do this SS defaults to using the Page.ss template.
For example I have the following file:
Which contains the class:
And I've tried putting the template in the following:
None of which work. Can this be done or am I attempting the imposible?
9 September 2011 at 1:32pm
The location of a class and the template location are quite disjoint. Actually class paths in general in SS are usually redundant since the autoloader loads all of the classes for you.
What is likely causing the issue here is your class name. SS uses an _ in templates to denote an action - i.e ClassName_Action.ss. So when it comes time to pick your CaseStudies_ListPage it may think ListPage is the action, not part of the CaseStudies.
I suggest using CaseStudiesListPage as your class name since convention would state that, or you may be able to explicitly define a template file on your class
static $template = 'CaseStudies_ListPage';
|Go to Top|