Michelle
Michelle

Reputation: 249

Kentico - Display content of localization resource strings through repeater transformation

I have a custom pagetype with 1 text field where I keep re-usable html content to be included on other pages through a repeater. The transformation for the repeater has just 1 line of code <%# Eval("Content") %>.

I'm running into a situation where I want to use a resource string inside the content box together with other html content, something like {$ site.languages $}. However, when viewing, the pages displays this string {$ site.languages $} instead of the value of the resource string. Is it possible to display the resource string content in this case and how?

Upvotes: 0

Views: 475

Answers (2)

AYK
AYK

Reputation: 1

Try this:

  1. ASCX transformations – call the Localize transformation method:

    <%# Localize("Text containing localization expressions: {$stringKey$}") %>

  2. Text / XML transformations – use localization string macro expressions or the GetResourceString macro method:

    {$stringKey$} - OR - {% GetResourceString("stringKey") %}

Upvotes: 0

mnield
mnield

Reputation: 1869

Try using

<%# Localize(Eval("Content")) %>

Upvotes: 1

Related Questions