Passing Dictionary Items Into Macro Template Calls (Not Working)
I've been wrestling with this one for a good few hours now.
I have a master page (template) and its a package based macro, meaning I would have to reflect the code in order to pull dictionary items out within the package itself, because the package is made up from a DLL currently.
Like I in general pass page property items into a macro as such...
This however has no effect and in fact comes out blank. I assure you these terms do exist in the Settings -> Dictionary section and these keys do have text values.
Firstly can this be done? If not them wouldn't this be a fundamental problem?
I understand I should put the code...
umbraco.library:GetDictionaryItem('dictionaryTermKey') in my XSLT or C# code, but this component is a package based one with a DLL as opposed to source code.
I have since wrote a MacroWrapper user control using the code (where plhMacro is a placeholder)
You can't insert dictionary item in a Macro using Parameters [#someItem] is a dictionary if you use it in a pageItem but if you pass it into a Macro it has another meaning and that is the name of the propertyAlias on your current page.
I always pass the name of the dictionary item to the macro and use umbraco.library:GetDictionaryItem($[your dictionaryitem her]) to retreive the translation in the XSLT, or umbraco.library:GetDictionaryItem'("Some dictioneryitem") in my .net Usercontrol to get the translation.
hi, if I writeumbraco.library:GetDictionaryItem("Some dictioneryitem") will render content, but if i create a macro that has set as a parameter dict_item and call umbraco.library:GetDictionaryItem(paramDict) will not render any result, why?
Passing Dictionary Items Into Macro Template Calls (Not Working)
I've been wrestling with this one for a good few hours now.
I have a master page (template) and its a package based macro, meaning I would have to reflect the code in order to pull dictionary items out within the package itself, because the package is made up from a DLL currently.
Like I in general pass page property items into a macro as such...
<umbraco:Macro runat="server" myparam="[$documentTypeField]" />
I want to do this with a dictionary item in order to make my system multilingual...
<umbraco:Macro runat="server" packageparam="[#dictionaryTermKey]" />
This however has no effect and in fact comes out blank.
I assure you these terms do exist in the Settings -> Dictionary section and these keys do have text values.
Firstly can this be done?
If not them wouldn't this be a fundamental problem?
I understand I should put the code...
umbraco.library:GetDictionaryItem('dictionaryTermKey') in my XSLT or C# code, but this component is a package based one with a DLL as opposed to source code.
I have since wrote a MacroWrapper user control using the code (where plhMacro is a placeholder)
This works for XSLT macros but somehow still doesn't set the UserControl properties in the Macro's User Control
HELP, any ideas beyond using reflector and extracting the code out and changing it?
Karl
(Using Umbraco 4.5.2 under .NET 3.5)
Any ideas?
Hi Karl,
You can't insert dictionary item in a Macro using Parameters [#someItem] is a dictionary if you use it in a pageItem but if you pass it into a Macro it has another meaning and that is the name of the propertyAlias on your current page.
I always pass the name of the dictionary item to the macro and use umbraco.library:GetDictionaryItem($[your dictionaryitem her]) to retreive the translation in the XSLT, or umbraco.library:GetDictionaryItem'("Some dictioneryitem") in my .net Usercontrol to get the translation.
Cheers,
Richard
hi, if I write umbraco.library:GetDictionaryItem("Some dictioneryitem") will render content, but if i create a macro that has set as a parameter dict_item and call umbraco.library:GetDictionaryItem(paramDict) will not render any result, why?
had a mistype, sorry. Is working
Why not put the whole macro tag in the Dictionary? It works! ;-)
is working on a reply...