Jump to:

3447 Posts in 1031 Topics by 872 members

Template Questions

SilverStripe Forums » Template Questions » Creating a holder of holders

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 539 Views
  • Lime Blast
    Avatar
    Community Member
    22 Posts

    Creating a holder of holders Link to this post

    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

    Articles (???)
    |- 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, ...)

    Thank you

  • IOTI
    Avatar
    Community Member
    189 Posts

    Re: Creating a holder of holders Link to this post

    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.

  • Lime Blast
    Avatar
    Community Member
    22 Posts

    Re: Creating a holder of holders Link to this post

    Thank you

  • goodness
    Avatar
    Community Member
    38 Posts

    Re: Creating a holder of holders Link to this post

    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.

    So:

    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

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