Hi,

The method ivy.cms.co(String uri, List<object> formatObjects) can be used with list of objects, so that you can pass dynamic data to your cms templates using {0} , {1} afterwards. However this method will always use the current locale. If we want to get a translation in another language, we can use the ivy.cms.coLocale(String uri, Locale locale) , but it seems this method does not take List<objects> so how can we pass the dynamic data ?

Thanks!

asked 20.08.2019 at 07:37

xchatter's gravatar image

xchatter
6619
accept rate: 0%

That would be good to know :)

(21.08.2019 at 03:19) a_v_a a_v_a's gravatar image
1

You could try the following: 1) set the desired locale on your session -> session.setContentLocale(Locale.GERMANY) 2) call .co(uri, list) which should now be executed with the just set locale 3) reset the locale on the session to its initial locale

(23.08.2019 at 05:53) Oliver Heer Oliver%20Heer's gravatar image

Thanks Oliver, this seems to be doing the job. :)

(26.08.2019 at 03:35) xchatter xchatter's gravatar image

Hello @oliver-heer Is the API lacking of this capability?

(28.08.2019 at 16:59) Alex Suter ♦♦ Alex%20Suter's gravatar image

@alex-suter you are absolutely right that we should enhance our API with a method that can handle the above case, I created issue XIVY-3314 where we should address that.

(28.08.2019 at 17:31) Oliver Heer Oliver%20Heer's gravatar image

There is no nice API for this use case. But there is a workaround:

1) set the desired locale on your session -> session.setContentLocale(Locale.GERMANY)

2) call .co(uri, list) which should now be executed with the just set locale

3) reset the locale on the session to its initial locale

There has been an issue created to improve the API (XIVY-3314).

link

answered 07.11.2019 at 07:59

SupportIvyTeam's gravatar image

SupportIvyTeam ♦♦
1.3k95113120
accept rate: 77%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×26

Asked: 20.08.2019 at 07:37

Seen: 253 times

Last updated: 07.11.2019 at 07:59