Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Add a page button

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

Page: 1
Go to End
Author Topic: 876 Views
  • Harley
    Avatar
    Community Member
    153 Posts

    Add a page button Link to this post

    Hi,

    I have set up a news holder and pages that can be created under that. Hopefully what I want to do though, is rather than the user having to create their own page etc... if I could create a tab titled 'Add news story' which basically has all the fields I need which they can then input into, which would take care of all the behaviour etc rather than them creating pages.

    Is this at all possible and does anyone have any ideas of how this could be achieved?

    Thanks

  • _Vince
    Avatar
    Community Member
    161 Posts

    Re: Add a page button Link to this post

    I'm not an expert, but perhaps you could remove the Content field and that way the users wouldn't be able to input random stuff.

    function getCMSFields() {

    $fields = parent::getCMSFields();
    $fields->removeFieldFromTab('Root.Content.Main', 'Content');

    return $fields;
    }

    You could then create a DataObject where you have all the fields or columns that make up the page.

    The users could then input stuff through a popup on a dedicated page or a tab.

    But there's probably better ideas out there.

  • zenmonkey
    Avatar
    Community Member
    528 Posts

    Re: Add a page button Link to this post

    You could do this with the DataObjectManager Module Quite easily.

    Create a DataObject containing your news fields and have it Managed with a DataObjectManager instead of pages.

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