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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

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

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

Template<% control %>Question


Go to End


3 Posts   823 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, 5523 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