Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

Template<% control %>Question


Reply


3 Posts   623 Views

Avatar
SSadmin

Community Member, 90 Posts

17 February 2010 at 4:33pm

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.

Avatar
Willr

Forum Moderator, 5513 Posts

17 February 2010 at 6:46pm

Try ClassName and no quotes.

<% if ClassName = ListingHolder %>

Avatar
SSadmin

Community Member, 90 Posts

18 February 2010 at 9:46am

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