This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

mkilian53123
mkilian53123

What is the best aproach to create multilanguage content in vanila october CMS Pages ? Rainlab staticPages store each language in different content file - seems logic.

By using vanila pages you can "simulate" this staticPages behavior with some if statements and partials. There is no support in pages to set different markup/code for each language.

Pseudocode:

if activeLang == "en":
     {% partial en_page_content %}
elif activeLang == "es":
     {% partial es_page_content %}

And with some other logic to check/create existence of this partials.

What is best way to achieve this behavior ?

Last updated

mjauvin
mjauvin

The equivalent of Rainlab.StaticPages multilingual content is achieved using the Rainlab.Translate plugin (see Content Translation section here: https://octobercms.com/plugin/rainlab-translate)

If you only want to translate strings in CMS Page Markup, use Rainlab.Translate's Message Translation.

mkilian53123
mkilian53123

Thank you. I've done some testing. Content blocks does support only text/html blocks. As far as i know Rainlab.StaticPages plugin stores "pages" in content directory, but treats it like pages (cms/class/Page) so you can use partials/snippets there.

mjauvin
mjauvin

Not sure what you're looking for, you seem to want Rainlab.StaticPages functionality but you are searching for something else?

Maybe you want to use components within Rainlab.StaticPages?

mjauvin
mjauvin

Look at the "Snippets created from components" section in Rainlab.StaticPages docs

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.