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.

Customising the CMS /

Revove Pages from CMS Sitetree


Reply


4 Posts   1080 Views

Avatar
DeklinKelly

Community Member, 197 Posts

14 August 2010 at 6:39am

I want to remove all pages with a page class of "Video" from the CMS sitetree.

Attached Files
Avatar
swaiba

Forum Moderator, 1804 Posts

18 August 2010 at 3:23am

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 '';
      }

      ...

      }

      ...

}

Avatar
frankmullenger

Forum Moderator, 53 Posts

20 October 2010 at 4:27pm

You can use the static $hide_ancestor var in class SiteTree but can only hide an ancestor I imagine, rather than any class.

Avatar
swaiba

Forum Moderator, 1804 Posts

20 October 2010 at 11:49pm

With this I ended up making my pages non-existent in the sitetree, rather than hiding them...