Jump to:

1380 Posts in 491 Topics by 520 members

Themes

SilverStripe Forums » Themes » Extending the admin menu (LH side)

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 276 Views
  • Little Giant
    Avatar
    Community Member
    4 Posts

    Extending the admin menu (LH side) Link to this post

    Hey folks,

    My developers are constantly running into an issue where they have too many admin items in the LH main menu - potentially confusing the h*ll out of the client. What I have asked is that they group related functions into a group menu item eg. "Settings" or "Communication" etc.

    Ideally, when a group tab is clicked it will expand to reveal further sub functions. Accordian style - but does not have to involve any complex Jquery.

    Has anyone discovered a way of extending the default admin menu so that child lists could be inserted - as they have indicated this would be a major update? It seems a very simple concept to me??

    As a (very crude) example...

    <li class="link" id="Menu-Communication" title="Communication">
    <a href="admin/business-registrations/">
    <span class="icon icon-16 icon-communication">&nbsp;</span>
    <span class="text">Communication</span>
    </a>

    <!-- insert child functions -->
    <ul>
    <li>Newsletter signups</li>
    <li>Business Registrations</li>
    <li>Personal Registrations</li>
    </ul>
    </li>

  • Little Giant
    Avatar
    Community Member
    4 Posts

    Re: Extending the admin menu (LH side) Link to this post

    So judging by the lack of response... this may be a common issue?

  • thomas.paulson
    Avatar
    Community Member
    72 Posts

    Re: Extending the admin menu (LH side) Link to this post

    Hi

    You can create sub-menu.

    Copy and paste framework/admin/templates/Includes/LeftAndMain_Menu.ss to mysite/templates/Includes/LeftAndMain_Menu.ss.

    SilverStripe will pick the new menu, also flush the cache ie ?flush=all.

    On my previous project, PM asked me to create two sub-menus under Files, i copied the menu template, and updated like mentioned below.

          <% loop $MainMenu %>
             <li class="$LinkingMode $FirstLast <% if $LinkingMode == 'link' %><% else %>opened<% end_if %>" id="Menu-$Code" title="$Title.ATT">
                <a href="$Link" $AttributesHTML>
                   <span class="icon icon-16 icon-{$Code.LowerCase}">&nbsp;</span>
                   <span class="text">$Title</span>
                </a>
                <% if Code == 'AssetAdmin' %>
                   <ul>
                      <li class="first <% if Top.class == 'AssetAdmin' %>current<% end_if %>" id="Menu-AssetAdmin">
                         <a href="admin/assets/">
                            <span class="text">Edit</span>
                         </a>
                      </li>
                      <li class="last <% if Top.class == 'CMSFileAddController' %>current<% end_if %>" id="Menu-CMSFileAddController">
                         <a href="admin/assets/add">
                            <span class="text">Add files</span>
                         </a>
                      </li>
                   </ul>
                <% end_if %>
                
             </li>
          <% end_loop %>

    reference
    -------------------
    http://doc.silverstripe.org/framework/en/trunk/howto/extend-cms-interface

  • Little Giant
    Avatar
    Community Member
    4 Posts

    Re: Extending the admin menu (LH side) Link to this post

    Thank you Thomas. That looks really good - I have passed onto my devs, I am sure they will be eager to try it out

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