开发者

Some menu customisation in Silverstripe

开发者 https://www.devze.com 2022-12-27 02:08 出处:网络
1) i need set different class name for every menu item, based on a menu row (iterating, i need just a number)

1) i need set different class name for every menu item, based on a menu row (iterating, i need just a number)

<% control Menu(1) %>
<div class="mainmenu-item-$MenuItemRow"><a href="$Link">$MenuTitle</a></div>
<% end_control %>

2) is there a simple way to create an small seco开发者_运维问答nd menu ?


<% control Menu(1) %>
    <div class="mainmenu-item-$Pos"><a href="$Link">$MenuTitle</a></div>
<% end_control %>

http://doc.silverstripe.org/built-in-page-controls#dataobjectset_options

Question 2:

if it should just show another level of your navigation you can use eg. <% control Menu(2) %>. And maybe this thread helps you about how to display only special items: http://silverstripe.org/archive/show/197044. Think also of the possibility that you could have menu items in your page tree for you sub-navigation that are only redirects to items somewhere else in the hierarchy! So you could eg. create a seperate "Footer" branch in your page tree and use:

<div class="footer">
    <% control ChildrenOf(footer) %>
        <span>
            <a href="$Link" title="Go To '$MenuTitle.XML'">$MenuTitle.XML</a>
        </span>
    <% end_control %>
</div>
0

精彩评论

暂无评论...
验证码 换一张
取 消