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

A completly different page in CMS


Go to End


5 Posts   1046 Views

Avatar
JonShutt

Community Member, 244 Posts

28 September 2011 at 11:01pm

Hi,

Using class ModelAdmin one can add a new tab into the CMS to control dataobjects - what I'm wondering if there is a way to add a new tab, which just loads an SS page template - which can then be used to display/work with data in a complete templateled and free way...

this would be great - for creating a kind of dashboard page with various bits of info, and for displaying reports using charts and stats etc etc...

Cheers

Avatar
swaiba

Forum Moderator, 1899 Posts

28 September 2011 at 11:29pm

absolutely - you might add a LiteralField to a new tab... populated with some data put into a template...

function getCMSFields() {
$fields = parent::getCMSFields();

$vd = new ViewableData();
$ad = new ArrayData(array('Info' => DataObject::get('SomeObject'));
$strSomeHTML = $vd->customise($ad)->renderWith('TemplateName');
$fields->addFieldToTab('Root.Bookings', new LiteralField('Label', $strSomeHTML));

return $fields;
}

Avatar
JonShutt

Community Member, 244 Posts

29 September 2011 at 9:58am

Hi Swaiba - thanks for that snippet...

Note: I'm trying too add a tab to the very top of the CMS - along with 'pages' 'files and images' etc...

infact, I've just found:
http://doc.silverstripe.org/sapphire/en/reference/leftandmain?s=extra%252520menu%252520items
which seems to be what I need...

Avatar
swaiba

Forum Moderator, 1899 Posts

29 September 2011 at 9:34pm

Ahhh... Then this may be of interest to you...

http://www.silverstripe.org/dashboard-module/

I've taken this and put graphs with http://chart.apis.google.com into it to make a dashboard for a client

Avatar
JonShutt

Community Member, 244 Posts

29 September 2011 at 11:19pm

that looks like a great module - a great starting point to add more stuff to...

thanks for pointing it out...