Hi!
I'm fairly new to SilverStripe, but not to OO PHP5 or development in general. Firstly, from what I've seen so far I'm really liking SilverStripe.
I am currently using it to build a site wherein most of the pages that need to be under CMS control are pretty much identical to the base Page class. I.e. A title and a big rich text field is all that's needed.
However, the look and feel of some of these pages is radically different, hence they need different templates.
Now there seems to be two options (possibly more, but like I said, I'm new) for me to get the different templates working for these different, but similar pages.
1) I can just put a switch statement in the index action function within PageController and test something unique to each instance and then apply different templates.
I.e.
Switch (UniqueThing) {
case '1':
use template A;
...
case 'n':
use template N;
}
2) Create a different sub page class for each unique page design and let that call the required template automatically. I.e. HomepagePage, ArticlePage, TermsPage etc etc.
I can see minor pro's and con's with either approach. I just wanted to ask the forum which way would be considered the 'SilverStripe way'?
Cheers in advance!