Using Umbraco7 I have made a PartialView based on Umbracos Sitemap.
I have managed to add a "current" class to the current <li> but I would like to target the parent UL aswell.
The reason why I need this is because when I access a page inside the UL my dropdown collapse. Example: www.sp34k.dk
If I had a parenttocurrent class I could target the UL with CSS and give it a display block so even after the postback, the UL is still expanded.
A quick overview:
<ul>
<li>
<ul> <-This guy needs a Current/Parent Class
<li class="current">
Here you are
</li>
</ul>
</li>
If I insert that line I don't get an error line, but on the frontend it says: Error loading Partial View script (file: ~/Views/MacroPartials/navigation.cshtml)
That a generic error message, more info can be found in you logfile in /App_Data/logs. Can you check your latest logfile and post the last error message?
Navigation: add class to parent UL
Using Umbraco7 I have made a PartialView based on Umbracos Sitemap. I have managed to add a "current" class to the current
<li>
but I would like to target the parent UL aswell.The reason why I need this is because when I access a page inside the UL my dropdown collapse. Example:
www.sp34k.dk
If I had a parenttocurrent class I could target the
UL
with CSS and give it a display block so even after the postback, theUL
is still expanded.A quick overview:
Partial view:
Hi Mike,
You could add the following just before the UL:
Cheers, Tom
Hey Tom,
Thank you very much for your reply! I tried inserting the line you wrote and it triggeres this issue inside the
Any()
"cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type"
I'm not sure exactly what that means.
Try:
Hey buddy!
If I insert that line I don't get an error line, but on the frontend it says:
Error loading Partial View script (file: ~/Views/MacroPartials/navigation.cshtml)
Hi! :)
That a generic error message, more info can be found in you logfile in /App_Data/logs. Can you check your latest logfile and post the last error message?
Dennis, this is the latest log file: http://sp34k.dk/error.txt
Okay, lets try this:
Works like a charm buddy! This has been nagging me for way too long haha.
Thanks to both you, Dennis and Tom for running through my problem and giving a helping hand.
Kudos to both!
Great news Mike. Glad i could help! And thank you Tom for providing the original fix. Have a great day both of you!
is working on a reply...