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.

All other Modules /

Discuss all other Modules here.

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

New Module : Create custom LeftAndMains with PanelModelAdmin


Go to End


10 Posts   5735 Views

Avatar
OzziNL

Community Member, 37 Posts

20 May 2011 at 3:33am

Edited: 20/05/2011 9:18pm

Hi Martijn,

I use the CategoryMenuPanel as in your product admin example. What I noticed is that all categories are shown, but I have some canView() lines for that DataObject.

So i added to line 37 of CategoryManager.php:

if(!$rootObjectItem->canView()) continue;

That works for me. Should it be added to code?

But now it shows the ID of my Category instead of the name like your example.

But I cannot do (the Category.Naam part):
$this->addPanel('MenuPanel4', new CategoryMenuPanel('Products', 'open', array(
'Category.Naam' => array('Product','OrderItem') // RootItems => ChildItems
)
), 'MenuPanel');

I cannot find a solution for this. Any idea?

UPDATE: found it: had no Title field in the DataObject,

Cheers,
Oscar

Avatar
iaogt

Community Member, 1 Post

5 August 2011 at 11:18am

Excellent work ! I was wondering how to start extending LeftAndMain class. Thanks !

Go to Top