문제

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 second 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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top