Jump to:

23491 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Can't remove tabs from extended RedirectorPage

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 485 Views
  • socks
    Avatar
    Community Member
    190 Posts

    Can't remove tabs from extended RedirectorPage Link to this post

    SS3.0.2

    I'm able to extend RedirectorPage. But for some reason, I can't remove tabs that I've created for other pages. I've successfully done this on other extended pages like BlogHolder. I tried removing 'MenuTitle' just to test and that works fine. So I tried removing fields from my tabs instead of the whole tab and that didn't work either. Just wondering if anyone has experienced the same issue.

    class RedirectorPageCustom extends DataExtension {

       static $has_one = array(
       );
       
       function updateCMSFields(FieldList $fields) {
          
          // REMOVE
          
          $fields->removeByName('FancyList'); // NOT WORKING
          $fields->removeByName('CallOut'); // NOT WORKING
          $fields->removeByName('Widgets'); // NOT WORKING
          $fields->removeByName('Snippets'); // NOT WORKING
          $fields->removeByName('Metadata');
          
          return $fields;
       }

    }

    thanks

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Can't remove tabs from extended RedirectorPage Link to this post

    I assume this is because the extension is called before the RedirectorPage getCMSFields. BlogHolder has a bit of a hack to get the order correct.

    https://github.com/silverstripe/silverstripe-blog/blob/master/code/BlogHolder.php#L40

    Seems like a terrible workaround though..

  • socks
    Avatar
    Community Member
    190 Posts

    Re: Can't remove tabs from extended RedirectorPage Link to this post

    Seems like it was working in pre-SS3 if I'm remembering correctly. Either way, thanks for the info Willr.

    485 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.