21308 Posts in 5737 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 994 Views |
-
Hiding pages in the CMS tree?

12 February 2009 at 1:23pm
I have a site with over 6000 pages of products, and I'm successfully using the modeladmin to deal with them appropriately, however, this amount of pages really shows down the CMS when I want to edit single blog/news items on the site.
Is there a way to remove them from the site tree in the CMS part, so that that admin area loads quicker and I can just deal with the products using Modeladmin only?
-
Re: Hiding pages in the CMS tree?

12 February 2009 at 2:40pm
Hi a-tech
this thread might help: http://www.silverstripe.org/general-questions/show/251987?start=8
It's not be exactly what ur looking for but might have some clues
-
Re: Hiding pages in the CMS tree?

12 February 2009 at 5:35pm
thanks aram,
I got some help from sam minnee on this and Works a treat!!
LeftAndMain::getSiteTreeFor() does most of the work - this is called in other places, passing "SiteTee", "Folder", or "Group" as necessary.
It's called by CMSMain::SiteTreeAsUL().It's currently like this:
$obj = $rootID ? $this->getRecord($rootID) : singleton($className);
$obj->markPartialTree(30, $this);
if($p = $this->currentPage()) $obj->markToExpose($p);
You can probably change it to have a call to setMarkingFilter. I woudl recommend that you make this change by duplicating the whole LeftAndMain::getSiteTreeFor() in either CMSMain, or your own custom subclass of LeftAndMain.$obj = $rootID ? $this->getRecord($rootID) : singleton($className);
--> $obj->setMarkingFilter('ShowInCMS', 1);
$obj->markPartialTree(30, $this);
if($p = $this->currentPage()) $obj->markToExpose($p);
This means that the tree will only show objects where $dataObj->ShowInCMS = 1;public $ShowInCMS = 1; // on Page.php
public $ShowInCMS = 0; // on the class to exclude from the CMS.
| 994 Views | ||
|
Page:
1
|
Go to Top |


