Jump to:

3401 Posts in 979 Topics by 855 members

Template Questions

SilverStripe Forums » Template Questions » control children wrong level

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

Page: 1
Go to End
Author Topic: 610 Views
  • bartvanirsel
    Avatar
    Community Member
    88 Posts

    control children wrong level Link to this post

    Hi,

    Beneath i have a code example of the problem i encounter. In the second part i do a control Children but the control Children controls the children of the parent of the current page. When removing the menu part, the second part works fine. What could be causing this problem?

    <-- menu part -->
        <% if Menu(2) %>
    <% control Menu(2) %>
    <% if Children %>
    <li class="$LinkingMode"><a href="$Link" class="pijl" title="$Title.XML" class="pijl $LinkingMode">$MenuTitle.XML</a></li>
    <% else %>
    <li class="$LinkingMode"><a href="$Link" class="pijl" title="$Title.XML" class="pijl $LinkingMode">$MenuTitle.XML</a></li>
    <% end_if %>

    <% if LinkOrSection = section %>
    <% if Children %>
    <li class="ie_list">
    <ul>
    <% control Children %>
    <li><a href="$Link" class="$LinkingMode">$MenuTitle.XML</a></li>
    <% if LinkOrSection = section %>
    <% if Children %>
    <li class="ie_list">
    <ul>
    <% control Children %>
    <li><a href="$Link" class="$LinkingMode">$MenuTitle.XML</a></li>
    <% end_if %>
    </ul>
    </li>
    <% end_if %>
    <% end_if %>
    <% end_control %>
    </ul>
    </li>
    <% end_if %>
    <% end_if %>
    <% end_control %>
    <% end_if %>
    <!-- end menu part -->

    <!-- get children part -->
    <% control Children %>
    <div class="block overzicht tijdschrift">
    <h2>$Title</h2>
    <p><img src="<% control CoverImage %><% control SetWidth(120) %>$URL<% end_control %><% end_control %>" alt="$Title.XML" /></p>
    <a href="$Link" title="$Title.XML">Lees verder</a>
    </div>
    <% if MultipleOf(3) %>
    <div class="clear"></div>
    <% end_if %>
    <% end_control %>
    <!-- end get children part -->

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