Developer forum

Forum » CMS - Standard features » Multi language version of Global:Paragraph.Content(2396)

Multi language version of Global:Paragraph.Content(2396)

Adrian Ursu
Reply

Hi,

I have an issue with a multi-language website.
I want to list in a product list template, the content of a paragraph.

This works fine with <!--@Global:Paragraph.Content(2396)--> but if I change the language of the website, the content of the pargraph is not changed according to the language.

Is there any other tag or Razor script that I can use to accomplish this withour hardcoding the Area ID's?

Thanks,
Adrian


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

You can do something like this, getting the ID from the website settings or something:

<!--@Global:Paragraph.Content(<!--@ Area.Item.Setting-->)-->

The Global:Paragraph and the Global:Page tags are not handled as normal tags, but parsed in the end of the output - making this work, at least in theory.

BR Nicolai

 
Adrian Ursu
Reply

Well, I thought of that.

But this works only if I define an Area parameter for every case.

It looks like I am going to need a Razor function to return the correct paragraph content taking into consideration the language

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

You can do that using the Dynamicweb.Content.Paragraph class. Be aware of performance - consider caching the ID's.

 
Adrian Ursu
Reply

Hi Nicolai,

Tried it but it seems to do the same thing as RenderParagraph Content.

We'll probably create a function that will do it correctly.

Thanks,
Adrian

 

You must be logged in to post in the forum