I’m a newbie to Umbraco and just gone through the CWS
tutorial (very impressed so far) – So I decided to take one of our websites
(what I thought would be a simple one) and set it up using Umbraco.
The first problem I have encountered is the menu structure.
It is a simple two level menu but some of the nodes are not linked to a page.
For example in the sample HTML below “Expertise” and “Systems” are not linked.
I suppose you need to decide how you want to determine if a node should be "linked" or not. You could do this by checking for a certain document type (ie "Container"), a property on the document (ie checkbox "disableLink") or maybe just the fact that it has children? Either way once you decide how to determine this, you can account for that easily in your XSLT.
Unordered List Menus
I’m a newbie to Umbraco and just gone through the CWS tutorial (very impressed so far) – So I decided to take one of our websites (what I thought would be a simple one) and set it up using Umbraco.
The first problem I have encountered is the menu structure. It is a simple two level menu but some of the nodes are not linked to a page. For example in the sample HTML below “Expertise” and “Systems” are not linked.
<ul id='mainMenu'>
<li><a href='/index.aspx' title='Home'>Home</a></li>
<li><a href='/proposition.aspx' title='Proposition'>Proposition</a></li>
<li><a href="#">Expertise</a>
<ul class="noJS">
<li><a href="/treasury.aspx">Treasury and Liquidity</a></li>
<li><a href="/risk.aspx">Risk Management</a></li>
<li><a href="/rating.aspx">Rating Advisory</a></li>
<li><a href="/operations.aspx">Operations</a></li>
</ul>
</li>
<li><a href="/regulatorynetwork.aspx">Network</a></li>
<li><a href="#">Systems</a>
<ul class="noJS">
<li><a href="/systems.aspx">System Implementation</a></li>
<li><a href="/software.aspx">Software</a></li>
</ul>
</li>
<li><a href="/support.aspx">Support</a></li>
<li><a href='/contact_us.aspx' title='Contact us'>Contact us</a></li>
<li><a href='/career.aspx' title='Career'>Career</a></li>
</ul>
The question is how can I reproduce this structure using macros in Umbraco?
TIA
David
Hi David,
I suppose you need to decide how you want to determine if a node should be "linked" or not. You could do this by checking for a certain document type (ie "Container"), a property on the document (ie checkbox "disableLink") or maybe just the fact that it has children? Either way once you decide how to determine this, you can account for that easily in your XSLT.
Quick example...
Hope this helps,
Tom
Hi David,
Create a Macro called "Navigation" - just use the "Clean" template.
Replace the XSLT generated with this and you're off to a good start:
/Chriztian
Ooops - Tom, didn't see your reply before posting mine :)
/Chriztian
Well I'm glad you did, yours is a bit more informative :) Didn't have time to do that myself!
Thanks Tom - soon as I posted it I thought of creating a placeholder menu item using a specific document type.
And thanks Chriztian - wasn't expecting someone to write the code - cheers :0)
is working on a reply...