Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Add a page button


Go to End


3 Posts   1383 Views

Avatar
Harley

Community Member, 165 Posts

31 August 2009 at 8:47pm

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

Avatar
_Vince

Community Member, 165 Posts

1 September 2009 at 9:00am

Edited: 01/09/2009 9:01am

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.

Avatar
zenmonkey

Community Member, 545 Posts

2 September 2009 at 1:18pm

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.