Jump to:

5453 Posts in 1674 Topics by 1198 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Adding Categories Tab to CMS (recipes:many_many-example )

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

Page: 1
Go to End
Author Topic: 1764 Views
  • earleysc
    Avatar
    Community Member
    5 Posts

    Adding Categories Tab to CMS (recipes:many_many-example ) Link to this post

    Hello. I am using SilverStripe to build a news Web site for a high school journalism class. I am well versed in basic html and CSS and have received an aerial-level introduction to object oriented programming and php but otherwise am brand new to CMS development.

    I am following along with the many_many tutorial in the documentation, which covers how to add checkboxes to a tab in the CMS so that users can assign articles to categories.

    I got the new tab to appear but it's not obvious to me precisely where/how I define the categories I want. (For example, News, Sports and Opinion would be a few of them.) I'm guessing this would happen when the TableField is created in ArticleHolder.php?

    Could someone point me in the right direction?

    Thanks!

  • earleysc
    Avatar
    Community Member
    5 Posts

    Re: Adding Categories Tab to CMS (recipes:many_many-example ) Link to this post

    OK. For now, in "Article.php", I just defined the $categoryList variable manually as an array listing the checkbox names I wanted. Probably not ideal, I know, but this is enabling me to move forward.

  • phawley
    Avatar
    Community Member
    21 Posts

    Re: Adding Categories Tab to CMS (recipes:many_many-example ) Link to this post

    Hey there...you need to create an ArticleHolder page in your CMS first, and then inside of that (in the CMS) you may create the categories which will subsequently appear as checkbox items in each Article page. The Category creator function is not the most intuitive (Where do you click to enter the Category title? When does one click + Add Category (before or after typing in the title?, etc.).

    Hope this helps,
    Patrick

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