<xsl:for-eachselect="$currentPage/ancestor-or-self::* [@isDoc and @level=1]/child::* [@isDoc and string(showInMainNav) = '1' and (title != '' or navigationTitle != '')]">
As RIch suggested above you should use the sitemap.xslt, which is found in the "create xslt wizard" window where there is a dropdown where it can be chosen. Then you should modify it to match your needs.
Then you will get all the specified levels. When that is done you should be able to apply the above styling.
Creating dropdown submenu of main menu
Hello Everyone,
I am not much aware of XSLT so please help me in creating submenu.
following is the code I am using in my site but I am not able to create dropdown submenu.
Hi,
Welcome to the forum!
It may help if you post the HTML you are trying to produce
Rich
Thank u so much..
I want menu of like this
<html>
<body>
<ul>
<li>Home
<ul>
<li>About Us</li>
<li>Company</li>
</ul>
</li>
<ul>
</body>
</html>
Hi,
I would create a new XSLT file and choose the 'Site Map' template, you should be able to tweak this to achieve what you need.
Let me know how you get on.
Rich
Ok, Please post it on this forum or mail me on [email protected]
Hi,
It's already in the back end, you just login to Umbraco, go to the developers sections press "create" and then choose the template.
Rich
Actualy, i have create menu by Macro using XSLT. So if you help me to make changes in posted XSLT to create submenu. i am realy greatful to you.
Thanks
Hi Nivedita
What does the code above output?
Is it creating a list structure like
<ul>
<li><a href="#">Item 1</a>
<ul>
<li>Subitem 1</li>
</ul>
</li>
</ul>
Then you should be able to create the dropdown effect simply by using CSS. A simple sample could be something like this...(from the top of my head)
li{position:relative}
li ul{position:absolute;top:20px;left:0;display:none}
li a:hover ul{display:block}
I hope this is what you're after and that i's enough to get you started :)
/Jan
Hello Everyone..
Basically I want to do some correction in the above code that i have posted.. because its giving me the menu bt not the submenu..
so please help me with this..
It Should look like this
Main1 Main2
| |
SubMenu1 SubMenu3
| |
SubMenu2 SubMenu4
Hi Nivedita
As RIch suggested above you should use the sitemap.xslt, which is found in the "create xslt wizard" window where there is a dropdown where it can be chosen. Then you should modify it to match your needs.
Then you will get all the specified levels. When that is done you should be able to apply the above styling.
Hope this helps.
/Jan
is working on a reply...