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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   884 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