Foros de discusión

Get articles with language_id parameter - SOLVED

thumbnail
Filippo Boatto, modificado hace 14 años.

Get articles with language_id parameter - SOLVED

Regular Member Mensajes: 107 Fecha de incorporación: 1/02/07 Mensajes recientes
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
Amos Fong, modificado hace 14 años.

RE: Get articles with language_id parameter

Liferay Legend Mensajes: 2047 Fecha de incorporación: 7/10/08 Mensajes recientes
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
Filippo Boatto, modificado hace 14 años.

RE: Get articles with language_id parameter

Regular Member Mensajes: 107 Fecha de incorporación: 1/02/07 Mensajes recientes
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
Filippo Boatto, modificado hace 14 años.

RE: Get articles with language_id parameter

Regular Member Mensajes: 107 Fecha de incorporación: 1/02/07 Mensajes recientes
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
Amos Fong, modificado hace 14 años.

RE: Get articles with language_id parameter

Liferay Legend Mensajes: 2047 Fecha de incorporación: 7/10/08 Mensajes recientes
oh interesting, I didn't know that. Anyways nice job!
thumbnail
Francesco Marangi, modificado hace 14 años.

RE: Get articles with language_id parameter

New Member Mensajes: 9 Fecha de incorporación: 6/02/09 Mensajes recientes
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 hace 11 años.

RE: Get articles with language_id parameter

New Member Mensajes: 9 Fecha de incorporación: 29/11/12 Mensajes recientes
Same happens for me. @language_id@ is not parsed in Web Content. Please post any suggestion or workaround. Thanks