Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Extending LeftAndMain 101

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

Page: 1
Go to End
Author Topic: 1065 Views
  • dendeffe
    Avatar
    Community Member
    135 Posts

    Extending LeftAndMain 101 Link to this post

    I'm starting to look at extending LeftAndMain and found the documentation here: http://doc.silverstripe.org/sapphire/en/reference/leftandmain

    I thought that adding this http://pastie.org/1925934 would at least give me the menu item My Admin in the CMS, but it doesn't even seem to do that. Can soemeone point me in the right direction?

  • swaiba
    Avatar
    Forum Moderator
    1784 Posts

    Re: Extending LeftAndMain 101 Link to this post

    I start with the following and build it up step by step...

    <?php
    class CustomAdmin extends LeftAndMain {
       static $url_segment = 'custadmin';
       static $menu_title = 'Custom';
       static $menu_priority = -2;
    }

    then also create two templates...
    CustomAdmin_left.ss
    CustomAdmin_right.ss

  • dendeffe
    Avatar
    Community Member
    135 Posts

    Re: Extending LeftAndMain 101 Link to this post

    I Feel really stupid now :O

    I forgot to add a _config.php to my folder. Thanks for the help.

  • dendeffe
    Avatar
    Community Member
    135 Posts

    Re: Extending LeftAndMain 101 Link to this post

    Alright, made something really simple (attached), before diving further into the ins and outs of LeftAndMain. There are probably a lot of things I can do easier with LeftAndMain functionality.

    If you have further tips, or see things that are a really bad idea, please let me know.

    Attached Files
  • BenWu
    Avatar
    Community Member
    87 Posts

    Re: Extending LeftAndMain 101 Link to this post

    That's a very good start for SS2.4

    What's the simliar for SS3.0? Looks like i am forced to use some kind of form and overwrite the getEditForm function

  • BenWu
    Avatar
    Community Member
    87 Posts

    Re: Extending LeftAndMain 101 Link to this post

    for SS3.0, i can follow the Dashboard module https://github.com/unclecheese/silverstripe-dashboard to extend LeftANDMain

    you have to make a new template

    ClassName_Content.ss

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