Hi there,
Coming from a ColdFusion background I am new to Silverstripe but so far I love it, and perhaps because I have a programming background, I found ALL of the tutorials easy to understand and an absolute must for "newbies". But there is one thing that currently has me stumped, and it is to do with the styling of the top level menu items. An example to demonstrate what I wish to achieve...
Currently my included navigation.ss file looks like so:
<ul>
<% control Menu(1) %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle</span></a></li>
<% end_control %>
</ul>
That's all fine and dandy and everything works fine. But I want more than just the page name in the menu text. The above would generate based on the four pages I have allowed to display:
<ul>
<li><a href="/home/" class="current"><span>Home</span></a></li>
<li><a href="/about-us/" class="link"><span>About Us</span></a></li>
<li><a href="/contact-us/" class="link"><span>Contact Us</span></a></li>
<li><a href="/news/" class="link"><span>News</span></a></li>
</ul>
But what I need is something more than just the actual Menu title in the link. i.e. in the above example I want to display:
<li><a href="/home/" class="current"><span>Home</span> GORE NZ</a></li>
Then I can use CSS to make the two look different and place the additional text on a new line. Is there any way of achieving this short of *hacking* with something like:
<ul>
<% control Menu(1) %>
<li>
<a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle</span></a>
<% if MenuTitle(home) %>
GORE NZ
<% else %>
<% if MenuTitle(about us) %>
AN OVERVIEW
<% end_if %>
</li>
<% end_control %>
</ul>
... although I just tried that and it adds GORE NZ to all of the navigation items. Any ideas or help appreciated.
TIA
Mark