3397 Posts in 978 Topics by 854 members
|Go to End|
28 May 2013 at 11:26pm
I've been following the tutorials on building a silverstripe site, and have learnt about the convention of creating Holder pages (such as ArticleHolder in the tutorial) which is used to contain individual articles (ArticlePage), etc..
My question is, what is the convention if you want to create a holder of holders?
Following the tutorial's example, lets say I want multiple holders, each representing a different category, all of which I want listed under a main articles page.
So that rather than having a tree structure like this:
Articles (Article Holder)
|- Why I'm so great (ArticlePage)
|- Why other people are greater (ArticlePage)
|- Why do I have such an ego (ArticlePage)
I have one more like this
|- All About Me (ArticleHolder)
| |- Why I'm so great (ArticlePage)
| |- Why other people are greater (ArticlePage)
| |- Why do I have such an ego (ArticlePage)
|- Activities (ArticleHolder)
| |- Why sports suck (ArticlePage)
| |- Why computer games rule (ArticlePage)
Is there a convention for the name of this upper page type? Do I have to name things as Holders, or would it be acceptable to name it something more relevent (such as CategoryPage, CategoryList, ...)
29 May 2013 at 12:03am
Hi Lime Blast,
I don't think there is really a naming convention for this structure, even the "*Holder" isn't really convention (as far as I know), just a nice, logical name for the page type. If I were you I would probably call my 2nd level holders "ArticleCategory" since as you said, they each represent a different category.
27 June 2013 at 9:49pm
17 July 2013 at 6:54am
It appears that the way you have it set in your 2nd example should work.
Assuming your Articles (???) page will be a page type that has ArticleHolder as children.
Then your ArticleHolder page types will accept the AtriclePage children to populate their content.
Articles = Page Type that has children set to ArticleHolder (AtricleHolderHolder ?)
ArticleHolder = Page Type that has children set to ArticlePage
ArticlePage = Pages that are children (in Site Tree) of their perspective Parent ArticleHolder pages
|Go to Top|