I think we must be misunderstanding each other. Let see if I can flesh out the whole issue...
On my site, we support multiple languages.
On our main menu, we have an item called Products, which links to a page called Products.
On this "Products" page we have a side nav, where we are rendering multiple projections. These projects are serving as Product filters. One of the projections is called Data Providers.
This Data Providers projection renders a list of products (in the current culture) that have been flagged as a Data Provider product. (The flag is set on a custom content type called Product)
So for illustration purposes here is the menu heirarchy:
Products (Page Content Type linked to menu)
- Data Providers (Projection)
- List of Products (Custom Content Type, which supports multiple cultures)
We are nearly finished build this site, and the navigation coupled with the culture has become the bane of our existence for the moment.
We have been banging our heads trying to get the side nav (which represents level 2+ menu items) to play nice with cultures. We setup multiple menus as such:
Main menu - which is shown on the home page that contains the following (Products, About, News, etc...)
Products menu - which contains the projections (Data providers, Industry Partners, etc...)
So if you were click Products from the main menu the breadcrumbs would show: Home / Products
The side nav would show:
If you clicked on the Data Providers projection you would see the listing of products that met the projection criteria, and the breadcrumb would now be:
Home / Products / Data Providers
If you clicked on one of the products the breadcrumb would now be: Home / Products / Product Name
All of this works in the "root" culture, but to get these items to show in the nav & breadcrumbs we were having to add to the Products menu the following in every culture:
Products Content page
Projections (Here's the rub, can't add projection more than once...)
Every product, we have 18 products x's 12 supported cultures
Also we hid the products from the side nav, in the view based on content type which we read from the model we applied a style to dom element and the use jQuery to hide it, so only want the projections to show, but the products had to be in the nav to work with
So our Products menu alone had 230 items, while a nightmare to administer it was quasi-working when we changed culture with exception of the projections. Because you can only put a projection once on a menu (and we understand why, it's basically culture agnostic),
we couldn't get it show anywhere but the root culture.
We had the epiphany to just create queries / projections to render all the content of the products area (and all others area too).
This would allow us to write a query for the top level (current culture, type = page, title = Products).
Then just the existing projections for the next level (Data providers...)
And the a query for each Product (Current culture, type = Product, title = Product Name)
So we did all that and it was working like a champ... Our menu went down to about 20 items (just each individual item) making it manageable.
This approach leaves us with a couple new issues:
- The menus are no longer translating as we change culture (because they are simply showing the projection title, and not the content title)
- I can't hide the products from the side nav because I no longer see their content type when they render due to them being projections, thus I wondered where can I get the content type of the thing being projected.
Here is the code that I use to hide the items, perhaps this will help some as well...
// odd formatting in this file is to cause more attractive results in the output.
var items = Enumerable.Cast<dynamic>((System.Collections.IEnumerable)Model);
// HACK: Hide the Products and OForm Inquiry Page in the products-menu
if (Model.Item.Content != null)
(Model.Menu.MenuName == "products-menu" & (Model.Item.Content.ContentItem.ContentType == "Product" || Model.Item.Content.ContentItem.ContentType == "OForm"))
|| (Model.Item.Content.ContentItem.ContentType == "OForm" & Model.Menu.MenuName == "news-menu")
@* morphing the shape to keep Model untouched*@
Model.Metadata.Type = "MenuItemLink";
@* render the menu item only if it has some content *@
var renderedMenuItemLink = Display(Model);
var tag = Tag(Model, "li");
All in all, I just want a way to show culture aware items on the menu, where we have projections involved.
Sorry for being so long winded, but I hope that better explains the issue I am having.