I want to remove all pages with a page class of "Video" from the CMS sitetree.
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.
I've looked into this, but haven't got there yet... this is from my notes... (you'll need to replace 'Logger' with your own method of debugging... a solution would be much appreciated by me too as I gave up!
class Hierarchy {
...
function getChildrenAsUL {
Logger::log($this);
if (isset($this->ClassName))
{
Logger::log($this->ClassName);
$do = new DataObject();
$do->setCalssName($this->ClassName);
$strName = get_parent_class($do);
if ($strName == 'YOURPAGECLASS')
return '';
}
...
}
...
}
You can use the static $hide_ancestor var in class SiteTree but can only hide an ancestor I imagine, rather than any class.
With this I ended up making my pages non-existent in the sitetree, rather than hiding them...