Jump to:

23380 Posts in 18311 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » Template<% control %>Question

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 586 Views
  • SSadmin
    Avatar
    Community Member
    90 Posts

    Template<% control %>Question Link to this post

    Hey,Guys.
    Is there a way we can customize the Menu Control for displaying specific results.

    For instance, i am using suckerfish .js for Top Level Dropdown Menu Navigation. I have pagetypes called ListingHolder and ListingPage.
    ListingPage is the sub-Page under ListingHolder tree. And i also got HomePage Type and normal Page Type.

    Since, there are two many listingPages so, if i run the code below , it will bring all the listingpages to the navigation menu as dropdown. more than 20+. so ugly.

    <div id="nav-wrap">
    <div id="nav" class="clearfix container">
       <ul>
          <% control Menu(1) %>   
             <li>
                <a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode">$MenuTitle.XML</a>
                
                   <ul class="transparent clearfix">
                      
                   <% control Children %>
                      <li>
                         <a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode">$MenuTitle.XML</a>
                      </li>
                   <% end_control %>
                   
                   </ul>
                </li>
          <% end_control %>
       </ul>
    </div> <!-- end div id nav -->
    </div><!-- end div id nav-wrap -->

    For short, i dont want the subpages of ListingHolder shows in the Navigation menu as a dropdown, but other pagetype can show.
    I have tried <% if Class="ListingHolder" %> <% end_if %> seems doesnt work.

    Any suggestions of it?!
    Thanks in advanced.

    Attached Files
  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Template<% control %>Question Link to this post

    Try ClassName and no quotes.

    <% if ClassName = ListingHolder %>

  • SSadmin
    Avatar
    Community Member
    90 Posts

    Re: Template<% control %>Question Link to this post

    Thanks Willr.
    It works perfect.
    i WILL keep in mind no Quotes in this statement.
    Thanks for ur time:D

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