How to display a list of sub pages from all other pages
Sorry, dummy question, still banging my head on it after a week though.
I have a products node, with sub nodes for categories and types, then the individual product pages under each of those.
I've made a razor macro with nested foreach's that displays the full list of products by category/type/product in a sidebar but it only shows up from the Products page, the one that all the rest of them are under.
Nothing shows up in the sidebar from the Home or other pages.
I've been dinking around with sitemap, AncestorOrSelf, Decendants, Model.DocumentType, etc, but I can't figure out how to get it to always show the listing of the one branch regardless which page you're on.
The included Razor macros like the SiteMap are so fast, compared to what I've done, I'd sure like to find a way to take advantage of them. I just could not figure out a way to get them to start at Products, instead of Home.
I don't know if it matters that each product has ~25 properties, about a third of which will be images. Ultimately there will be about 200 of them. Seems like performance will only get even worse as I poplulate the site with data.
I've also been messing around with adding a 'ShowInSideNav' property and adding that in a .Where filter in the simpler/faster sitemap macro but it doesn't seem to work they way I'm using it.
var items = node.Children.Where("Visible").Where("Level <= maxLevelForSitemap", values).Where("ShowInSideNav");
Maybe it blows up because that's not in the first level so it doesn't look farther.
I'm going to try the Model.Down().Next() shown in Gareth Evans, Feature Walkthrough.
How to display a list of sub pages from all other pages
Sorry, dummy question, still banging my head on it after a week though.
I have a products node, with sub nodes for categories and types, then the individual product pages under each of those.
I've made a razor macro with nested foreach's that displays the full list of products by category/type/product in a sidebar but it only shows up from the Products page, the one that all the rest of them are under.
Nothing shows up in the sidebar from the Home or other pages.
I've been dinking around with sitemap, AncestorOrSelf, Decendants, Model.DocumentType, etc, but I can't figure out how to get it to always show the listing of the one branch regardless which page you're on.
Hi Matthew,
Can you please show us your code and give an example of your content tree?
//fuji
Well, I got this to work (I lied, I guess there's 3 layers), but it is soooo slooooowww:
The content looks like:
Home
-Products
--Group1
---Category1
----Type1
-----Product1
-----Product2
----Type2
-----Product3
-----Product4
---Category2
----Type2
-----Product5
-----Product6
--Group2
---Category3
etc, etc, etc.
-About
-Contact
The included Razor macros like the SiteMap are so fast, compared to what I've done, I'd sure like to find a way to take advantage of them. I just could not figure out a way to get them to start at Products, instead of Home.
I don't know if it matters that each product has ~25 properties, about a third of which will be images. Ultimately there will be about 200 of them. Seems like performance will only get even worse as I poplulate the site with data.
Thanks very much for any help.
Matthew
I've also been messing around with adding a 'ShowInSideNav' property and adding that in a .Where filter in the simpler/faster sitemap macro but it doesn't seem to work they way I'm using it.
var items = node.Children.Where("Visible").Where("Level <= maxLevelForSitemap", values).Where("ShowInSideNav");
Maybe it blows up because that's not in the first level so it doesn't look farther.
I'm going to try the Model.Down().Next() shown in Gareth Evans, Feature Walkthrough.
http://umbraco.com/follow-us/blog-archive/2011/3/13/umbraco-razor-feature-walkthrough-part-5.aspx
but I'm not too optomistic.
Thanks again.
is working on a reply...