I'm spec'ing out an ecommerce site for an important group using the wicked combination of Umbraco and TeaCommerce, but I've hit a snag that I just can't figure out. I've enabled nesting a Product Category within another Product Category (a.k.a. Sub-Category, doesn't everyone need them?), but it breaks the Navigation.xslt from the StarterKit.
Here's the result of the page load, note that everything below the first <li> doesn't get it's class populated almost as if the XSLT is "stopping" after the first <li>:
<ul id="submenu" class="lvl1"> <li class="active inpath firstitem hasChildren"> <a title="Comics & Humor" class="active inpath firstitem hasChildren" href="/en/products/comics-humor.aspx">Comics & Humor</a> <ul class="lvl2"><li class="firstitem lastitem hasChildren"> <a title="New Releases" class="firstitem lastitem hasChildren" href="/en/products/comics-humor/new-releases.aspx">New Releases</a></li></ul></li> <li><a title="Puzzles & Games" href="/en/products/puzzles-games.aspx">Puzzles & Games</a></li> <li><a title="Cookbooks" href="/en/products/cookbooks.aspx">Cookbooks</a></li> <li><a title="Home & Crafts" href="/en/products/home-crafts.aspx">Home & Crafts</a></li> <li><a title="Non-fiction" href="/en/products/non-fiction.aspx">Non-fiction</a></li> <li><a title="Keepsake & Gift" href="/en/products/keepsake-gift.aspx">Keepsake & Gift</a></li> <li><a title="Children's" href="/en/products/children's.aspx">Children's</a></li> <li class="lastitem"><a title="Calendars" class="lastitem" href="/en/products/calendars.aspx">Calendars</a></li></ul>
Here's the unmodified XSLT (every change I made failed to fix the problem):
No not at all - but for some reason the umbraco xml isnt updated correctly so it only shows up in the navigation when you publish each sub category by it self. Try it. :)
Your problem seems to be that the "showOnlyCurrentPath" parameter is set to "1". You can see that in the template where you have the macro inserted. That parrameter sees to that the navigation.xslt only shows subpages of the active item. In your example above the "The Comics and humor" node is "active" and "inpath". If "showOnlyCurrentPath" is set to "0" all levels will be opened.
Maybe I should write a little blogpost on our navigation.xslt one of these days! It's pretty neat, if you know how to use it ;)
Wow, you guys rock, thanks for the awesome and quick support.
Here's what I had to do to get sub-categories to display in the submenu:
Unpublish each subcategory and product within
Manually publish each subcategory and product within individually
Rune, I did have showOnlyCurrentPath set to 0 so I could make sure to see all categories while testing and if I set it to 1 everything seems to still work ok. I would imagine if I opened it up to another level (i.e. Products, which I won't because there will be a ton) it would likely have issues though.
Just having a starting point (i.e. the Navigation.xslt in the starter kit) is an incredible thing, much appreciated. A blog post or wiki explaining it's usage would be beneficial, but it's very well laid out and even just a few comment lines within the XSLT might be just as effective. I may do just that and if I do I'll post the modified file.
Newb, have mercy, XSLT is driving me mad
I'm spec'ing out an ecommerce site for an important group using the wicked combination of Umbraco and TeaCommerce, but I've hit a snag that I just can't figure out. I've enabled nesting a Product Category within another Product Category (a.k.a. Sub-Category, doesn't everyone need them?), but it breaks the Navigation.xslt from the StarterKit.
Here's the result of the page load, note that everything below the first <li> doesn't get it's class populated almost as if the XSLT is "stopping" after the first <li>:
Here's the unmodified XSLT (every change I made failed to fix the problem):
Here's a look at my content tree, there are additional subcategories and products populated for the subcategories that are just not showing up.
Any suggestions, other than "learn more about XSLT"? :)
Hi Paul
XSLT is a little hard to start with - but you will learn it :)
What is the toLevel and numberOfLevels in the Macro parameters?
Thanks, it's on my list :)
fromLevel is 4 and numberofLevels is 2, just the OOB stuff
How did you publish the subcategories? Bulk publish? Try publish one by it self.
Bulk...was that a bad idea?
No not at all - but for some reason the umbraco xml isnt updated correctly so it only shows up in the navigation when you publish each sub category by it self. Try it. :)
Hi Paul,
Your problem seems to be that the "showOnlyCurrentPath" parameter is set to "1". You can see that in the template where you have the macro inserted. That parrameter sees to that the navigation.xslt only shows subpages of the active item. In your example above the "The Comics and humor" node is "active" and "inpath". If "showOnlyCurrentPath" is set to "0" all levels will be opened.
Maybe I should write a little blogpost on our navigation.xslt one of these days! It's pretty neat, if you know how to use it ;)
/Rune
Wow, you guys rock, thanks for the awesome and quick support.
Here's what I had to do to get sub-categories to display in the submenu:
Rune, I did have showOnlyCurrentPath set to 0 so I could make sure to see all categories while testing and if I set it to 1 everything seems to still work ok. I would imagine if I opened it up to another level (i.e. Products, which I won't because there will be a ton) it would likely have issues though.
Just having a starting point (i.e. the Navigation.xslt in the starter kit) is an incredible thing, much appreciated. A blog post or wiki explaining it's usage would be beneficial, but it's very well laid out and even just a few comment lines within the XSLT might be just as effective. I may do just that and if I do I'll post the modified file.
Big thanks once again Anders and Rune,
Paul
is working on a reply...