I was wondering if someone could look at the following xslt. The menu works correclty and list the sub pages with current page. But adds the hardcoded home page link to all nested list. If possible I need the link to only appear once and should be the first link of the root menu.
A simple mistake I missed, basically you need to check whether the nodes has any children BEFORE opening a ul - replace the current menu template with the above
All the <li> tags are being produced correctly, but the home page link has gone and the <ul> tags are missing or nested incorrectly. The above markup is from FF.
Tested the changes and the menu structure is spot on :-) Have tried to add the test so that any items hidden from menu are not displayed. Previously I done this with:
[string(data [@alias='umbracoNaviHide']) != '1']
But have tried adding in the test but get an error reading xslt file. If possible could you add in the test?
Homepage link showing in sub menu
Hi All
I was wondering if someone could look at the following xslt. The menu works correclty and list the sub pages with current page. But adds the hardcoded home page link to all nested list. If possible I need the link to only appear once and should be the first link of the root menu.
I've added comment tags around the part of the xlst that adds in the homepage link.
Thanks for your help.
Eddie
I've just re-jigged your code slightly, hopefully this should sort your problem
Hi Elspiko
Thanks for the quick reply. Have tested the revised code and only the home page link is listed! Any ideas?
Eddie
Try changing the "level" variable back to 1 - sorry, i haven't woken up properly yet
if this works can you please mark it as solved :)
Hi Elspiko
Thanks the home page link is now displayed correctly. But now the generated sub menus are not nesting correctly.
Thanks
Eddie
A simple mistake I missed, basically you need to check whether the nodes has any children BEFORE opening a ul - replace the current menu template with the above
Hi Elspiko
I appreiacte all of your help and thanks again for the quick response. The generated markup is now:
All the <li> tags are being produced correctly, but the home page link has gone and the <ul> tags are missing or nested incorrectly. The above markup is from FF.
The current xlst file is below:
Thanks
Eddie
I'll check this out later on today - watch this space ;)
Your a star, many thanks.
Hi Eddie, sorry its taken so long. Below is a version i've tested and seems to work well with the setup i have
I hope this solves the problem :)
Hi Elspiko
Tested the changes and the menu structure is spot on :-) Have tried to add the test so that any items hidden from menu are not displayed. Previously I done this with:
[string(data [@alias='umbracoNaviHide']) != '1']
But have tried adding in the test but get an error reading xslt file. If possible could you add in the test?
Thanks again for all your time and effort.
Eddie
Not a problem, happy to help. Sorry is been a bit long winded
Worked a treat, thanks again.
is working on a reply...