Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Redirect Site Content

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

Page: 1
Go to End
Author Topic: 904 Views
  • Mo
    Avatar
    Community Member
    508 Posts

    Redirect Site Content Link to this post

    Hi All,

    I am working on a simple dashboard module for Silverstripe, it is in a usable state (in my mind at least), however one thing is really bugging me.

    I was wondering if it is possible to redirect the page that appears when you click "Site Content" on the left the the CMS to my new class? I
    have tried adding :

    Director::addRules(100, array(
       'admin/0' => 'Dashboard'
    ));

    ... To the _config.php file, but that doesn't work. Anyone know if I can do this?

    Cheers,

    Mo

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Redirect Site Content Link to this post

    Hi Mo

    I'm not really sure, but can't you just use the CMSMenu class for this purpose (cms/code/CMSMenu.php)?
    What's probably useful for you is the static CMSMenu::replace_menu_item method. Using this method, you should be able to replace a menu item from your own _config.php file.

  • Mo
    Avatar
    Community Member
    508 Posts

    Re: Redirect Site Content Link to this post

    Hmm, CMSMenu seems only to control the top level nav, I am interested in redirecting the Site content link in the left nav though.

    I think I might have to make use of LeftAndMain, it looks like that is where the link is defined... I am just trying to work out how :S

    Mo

  • Mo
    Avatar
    Community Member
    508 Posts

    Re: Redirect Site Content Link to this post

    Actually, if I use CMSMenu, then I can add a Dashboard link to the top left, which would be better than using site content... It just opens up a whole new host of issues :s.

  • Mo
    Avatar
    Community Member
    508 Posts

    Re: Redirect Site Content Link to this post

    Right, I feel like I am running around in circles now.

    Basically, I want to change the default admin redirect, so that instead of /admin/ redirecting to:

    /admin/cms

    Instead it redirects to:

    /admin/dashboard

    Is this actually possible? I wouldn't have thought it would be to difficult, but I can't find anything documented about this anywhere :s

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