Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi guys,
I have a site with multiple variant cultures. For the sake of example we have the default site "en-GB" and an american alternative "en-US".
We show some pricing for various items on site. I'd like to be able to use variant cultures to display an alternative US price for a specific value.
I've set the language, and created the variant in the CMS. All working ok. If I preview the content within Umbraco I can see the differing content.
In my razor view, I'm trying to get the alternative content using the following code (as specified in the Documentation)
@Model.Value("price", "en-US", fallback: Fallback.ToLanguage)
However this doesn't return the value, instead only displaying the fallback.
Am I missing something, or is this functionality not actually possible like the docs imply? Do I need to set the culture in my surface controller for example?
Thanks, Luke
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Retrieving alternative variant culture content from specified culture code
Hi guys,
I have a site with multiple variant cultures. For the sake of example we have the default site "en-GB" and an american alternative "en-US".
We show some pricing for various items on site. I'd like to be able to use variant cultures to display an alternative US price for a specific value.
I've set the language, and created the variant in the CMS. All working ok. If I preview the content within Umbraco I can see the differing content.
In my razor view, I'm trying to get the alternative content using the following code (as specified in the Documentation)
However this doesn't return the value, instead only displaying the fallback.
Am I missing something, or is this functionality not actually possible like the docs imply? Do I need to set the culture in my surface controller for example?
Thanks, Luke
is working on a reply...