Jump to:

5521 Posts in 1733 Topics by 1220 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Revove Pages from CMS Sitetree

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

Page: 1
Go to End
Author Topic: 1014 Views
  • DeklinKelly
    Avatar
    Community Member
    197 Posts

    Revove Pages from CMS Sitetree Link to this post

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

    Attached Files
  • swaiba
    Avatar
    Forum Moderator
    1786 Posts

    Re: Revove Pages from CMS Sitetree Link to this post

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

          ...

          }

          ...

    }

  • frankmullenger
    Avatar
    Forum Moderator
    51 Posts

    Re: Revove Pages from CMS Sitetree Link to this post

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

  • swaiba
    Avatar
    Forum Moderator
    1786 Posts

    Re: Revove Pages from CMS Sitetree Link to this post

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

    1014 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.