First of all, this looks like a hardcoded menu - though - using the built-in Dictionary... and by the URLs I'm guessing you have all the pages at the same level, though your menu structure seems to suggest a nested hierarchy.
Here's a direct "port" of your code - it's not utilizing the power of XSLT (traversing the tree, etc.) but I'm guessing you want to get there next:
Yes - there's lots of ways to do this dynamically. I suggest you check out the default templates that ships with Umbraco (Developer > right-click XSLT folder and create a new file - choose "List Subpage by Level" and see how that's constructed). They show how to get the URL of a page, and it's name etc.
Then come back here with any questions you have from looking into that.
top nav
I'm new to XSLT & Umbraco and wonder if some one can point me in the right direction.
How would i create this menu using XSLT?
any help would be much great
<ul class="Btn">
<li><a href="en.aspx"><umbraco:Item field="#main nav" runat="server" /></a></li>
<li><a href="sgoiltean.aspx"><umbraco:Item field="#button 2" runat="server" /></a></li>
<li><a href="#"><umbraco:Item field="#button 3" runat="server" /></a>
<div>
<ul>
<li><a href="bhidiothan.aspx"><umbraco:Item field="#button 4" runat="server" /></a></li>
<li><a href="bilinguaslism-matters.aspx"><umbraco:Item field="#button 5" runat="server" /></a></li>
<li><a href="rannsachadh.aspx"><umbraco:Item field="#button 6" runat="server" /></a></li>
<li><a href="fios-is-freagairt.aspx"><umbraco:Item field="#button 7" runat="server" /></a></li>
<li><a href="tesisteanasan.aspx"><umbraco:Item field="#button 9" runat="server" /></a></li>
<li><a href="cothroman-cosnaidh.aspx"><umbraco:Item field="#button 8" runat="server" /></a></li>
</ul>
</div>
</li>
<li><a href="ceistean.aspx"><umbraco:Item field="#button 10" runat="server" /></a></li>
<li><a href="ceanglaichean.aspx"><umbraco:Item field="#button 11" runat="server" /></a></li>
</ul>
Thanks Chriztian
I've just started working with Umbraco this week. Here's the website structure within the contents section.
I'm creating a multilingual site.
Rather than hard coding the URL within the XSLT is there a way of getting the link to the parent page.
Hi Malick,
Yes - there's lots of ways to do this dynamically. I suggest you check out the default templates that ships with Umbraco (Developer > right-click XSLT folder and create a new file - choose "List Subpage by Level" and see how that's constructed). They show how to get the URL of a page, and it's name etc.
Then come back here with any questions you have from looking into that.
/Chriztian
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.