Try using the content as a rich text editor instead of just a standard text box as this would render it differently as you can add macros into an RTE which render like a dictionary item
Looking at the source, I don't think that what you are trying to do would work. It could potentially create an endless loop, since you could be writing out the same field that your getitem tag is in, thus causing it to render itself.
I would instead go with creating a macro, that writes out the dictionary item for you, based on an input parameter.
@Tom Maton the macro works without any problems. I could write a macro which gets the dictionary item, but thats imho a workaround.
@Morten Bock I'm using the latest version 4.5.2. What's the correct syntax the use? I searched the documentation, forum, googled it. But couldn't find anything.
Use a dictionary item in the content
How can I use a dictionary item in the content?
<?UMBRACO_GETITEM field="#Field"/>
This works inside a template, but I want to use it in the content like this:
Hi Wouter
Try using the content as a rich text editor instead of just a standard text box as this would render it differently as you can add macros into an RTE which render like a dictionary item
Thanks
Tom
Which version of umbraco are you using? Looks like an older syntax?
Looking at the source, I don't think that what you are trying to do would work. It could potentially create an endless loop, since you could be writing out the same field that your getitem tag is in, thus causing it to render itself.
I would instead go with creating a macro, that writes out the dictionary item for you, based on an input parameter.
@Tom Maton the macro works without any problems. I could write a macro which gets the dictionary item, but thats imho a workaround.
@Morten Bock I'm using the latest version 4.5.2. What's the correct syntax the use? I searched the documentation, forum, googled it. But couldn't find anything.
So there's no tag for using a dictionary item?
Maybe something like {Locallink:1234}?
The syntax would be like this:
Try it out, but I don't think it will work. Let us know.
Nope, that doesn't work since it doesn't get parsed by .net, tried it anyway :-)
I resolved it by using a macro which gets the dictionary item provided by a macro parameter.
Thanks all for your support.
For future reference :-)
<?UMBRACO_MACRO macroAlias="GetDictionaryItem" dictionaryItem="RenteDisclaimer"/>
----- GetDictionaryItem.xslt ----
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:variable name="dictionaryItem" select="/macro/dictionaryItem"/>
<xsl:template match="/">
<xsl:value-of select="umbraco.library:GetDictionaryItem($dictionaryItem)" disable-output-escaping="yes" />
</xsl:template>
</xsl:stylesheet>
is working on a reply...