Jump to:

7938 Posts in 1541 Topics by 945 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Dynamic fields for Pages based on categories

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 518 Views
  • Zyzzza
    Community Member
    25 Posts

    Dynamic fields for Pages based on categories Link to this post

    Hi All,

    I've got a task to implement, which I'm stuck with so maybe someone could suggest which approach should I use. The main idea is:

    We've got a catalog of ITEMS (for now this is one Page class Item.php ) where each Item belongs to a Category (Thus we've got category list, with ITEM pages in each category)

    I need to code a solution for adding additional custom fields (with different datatypes) which would be entered for each category, and would be filled for each Item in that category . To make it clear:

    In the CMS :
    Client comes to "Phones" Category
    Adds fields and their types :
    1. Weight - [Numeric]
    2. Short Code - [Varchar]
    3. Description for bulk retailers - [HTMLText]

    Now Client saves this Category, and all the ITEMS in that category would get those fields availiable in DataObjectManager (or somehow in other way) for filling with proper form elemens. Thus for each Phone client would be able to add Weight, ShortCode and Description.

    So for each category he has to have a chance of entering custom fields, which would populate to ITEMS under this Category. Thus this is somehting like doing flexible/custom $db variables for ITEMS underneath category.

    Anyone could suggest which logic/modules should I use or at least take a look at for implementing this ? I assume UserForms has something like that, as you can create fields dynamically, but they are not populating over the children pages, so any ideas/help would be appreciated.

    Thank you.

  • Zyzzza
    Community Member
    25 Posts

    Re: Dynamic fields for Pages based on categories Link to this post

    Bump, any suggestions ?

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.