Get articles with language_id parameter - SOLVED

thumbnail
29941, modificado 16 Anos atrás. Regular Member Postagens: 107 Data de Entrada: 01/02/07 Postagens Recentes
with this code a have the last article o type "products"

http://@portal_url@/c/journal/get_articles?groupId=@group_id@&type=products&delta=1&approved=true&expired=false&[b]language_id=@language_id@[/b]&orderBy=display-date


but the language_id=@language_id@ seems to be ignored...why?

P.S. the article uses a structure and a template. It is inserted with localized check box checked.
thumbnail
1395288, modificado 16 Anos atrás. Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
Hi Filippo,

That doesn't appear to be a valid token. See the full list in journalUtil.java. Try using $locale instead.

If you haven't already found it, this is a good list of velocity variables available to you:

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/How%20To%20Access%20Objects%20From%20A%20Velocity%20Template
thumbnail
29941, modificado 16 Anos atrás. Regular Member Postagens: 107 Data de Entrada: 01/02/07 Postagens Recentes
The problem is not the @language_id@ because it contains the same value of $locale.

te problem is that the get_articles doen't matter the language_id parameter:

http://10.1.4.191:8082/portal/c/journal/get_articles?groupId=12501&[b]language_id=en_US[/b]&type=marketing&delta=1&approved=true&expired=false&orderBy=display-date

and

http://10.1.4.191:8082/portal/c/journal/get_articles?groupId=12501&[b]language_id=it_IT[/b]&type=marketing&delta=1&approved=true&expired=false&orderBy=display-date

does not returns the same article in English or Italian but returns always the same article in the same language.

I've tried this in the portlet WebContent dysplay in my portal and it does not work, with or without language_id parameter.
BUT if i try the link, without the language parameter, in another window,

http://10.1.4.191:8082/portal/c/journal/get_articles?groupId=12501&type=marketing&delta=1&approved=true&expired=false&orderBy=display-date

it returns the right article with the current language selected in the portal.
thumbnail
29941, modificado 16 Anos atrás. Regular Member Postagens: 107 Data de Entrada: 01/02/07 Postagens Recentes
the parameter to use is:

&[b][color=#00C002]languageId[/color][/b]=@language_id@


and NOT:

&[b][color=#C00300]language_id[/color][/b]=@language_id@



I use this URL

http://@portal_url@/c/journal/get_articles?groupId=@group_id@&[b]languageId=@language_id@[/b]&type=marketing&approved=true&expired=false&delta=1&orderBy=display-date



look at Wiki
thumbnail
1395288, modificado 16 Anos atrás. Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
oh interesting, I didn't know that. Anyways nice job!
thumbnail
2120788, modificado 16 Anos atrás. New Member Postagens: 9 Data de Entrada: 06/02/09 Postagens Recentes
Hi guys,

I wanted to have access to the current locale inside a text area of a journal article .

Other tokens, like @root_path@ and @main_path@, work as expected, but somehow @language_id@ is not parsed and is returned as is. What's wrong with that? Should i set up something in the .properties files? I'm not talking about Velocity Templates, i want to access these tokens from a web content directly.

Can anybody help me with that? Thanks a million!

Francesco
Alex Galkin, modificado 13 Anos atrás. New Member Postagens: 9 Data de Entrada: 29/11/12 Postagens Recentes
Same happens for me. @language_id@ is not parsed in Web Content. Please post any suggestion or workaround. Thanks