changing the field property for the umbraco:Item control
Hi there
Is there any way to alter the value of the field attribute in the umbraco:Item element in the master template, depending on the value held in a session variable?
I would like to use it when the user swaps language (stored in a Session variable).
The language is set / checked in every template, and depending on the value, it prefixes my fieldname and the usercontrol outputs the value accordingly.
The Language parameter defaults to the current language or English if it is not set.
Perhaps not the most elegant solution, but it solves the problem I faced of using one template for two languages.
changing the field property for the umbraco:Item control
Hi there Is there any way to alter the value of the field attribute in the umbraco:Item element in the master template, depending on the value held in a session variable?
I would like to use it when the user swaps language (stored in a Session variable).
would become
through something like this:
I've come across some really useful solutions using macros, and I've got a quick and dirty solution using a ContentPlaceHolder.
Thanks in advance, Muiris
Hi Muiris,
Are you using masterpages with Umbraco 7?
/Alex
Hi Alex,
yes, I am using masterpages.
I've solved my problem using a usercontrol in my templates, which looks something like this:
The language is set / checked in every template, and depending on the value, it prefixes my fieldname and the usercontrol outputs the value accordingly.
The Language parameter defaults to the current language or English if it is not set.
Perhaps not the most elegant solution, but it solves the problem I faced of using one template for two languages.
Thanks for sharing,
For WebForms it's great solution!!!
Topic is solved.
/Alex
Hi Alex
I've had to rewrite my solution for RTE properties of doctypes, if they contain a usercontrol, and thought it might be relevant to this discussion.
Here's the link:
https://our.umbraco.org/forum/templates-partial-views-and-macros/86736-page-events-eg-page_load-are-being-fired-twice
is working on a reply...