Hi Everyone, I'm new to Umbraco and Razor. I'm trying to generate a list of pages on a parent page. On the French version of the page, I want it to fallback to the default language (English) for any item in the list that doesn't have an equivalent published French page. This allows us to publish release notes in English and show the English details there until the French page is published a few days later. The following code works just fine in English:
The problem I'm having is that all the examples explain how to specify a fallback value for a property, but I'm trying to get it to include pages from the fallback language in the list pages. I suspect something is missing from how I am defining the variables, but I'm not sure what.
Fallback language in razor query
Hi Everyone, I'm new to Umbraco and Razor. I'm trying to generate a list of pages on a parent page. On the French version of the page, I want it to fallback to the default language (English) for any item in the list that doesn't have an equivalent published French page. This allows us to publish release notes in English and show the English details there until the French page is published a few days later. The following code works just fine in English:
Next, I have the following code, which fails when viewing the page in French as there is no French version of a Product2 page:
It fails specifically on the line
@{ var product2Current = product2Releases.First();}
I've read all that I can find about the fallback languages. This was helpful: https://our.umbraco.com/Documentation/Getting-Started/Design/Rendering-Content/#using-fall-back-methods
The problem I'm having is that all the examples explain how to specify a fallback value for a property, but I'm trying to get it to include pages from the fallback language in the list pages. I suspect something is missing from how I am defining the variables, but I'm not sure what.
is working on a reply...