Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Edouard Perr
Specify a templateId in /c/journal/view_article_content Action
November 13, 2012 2:56 AM
Answer

Edouard Perr

Rank: Junior Member

Posts: 30

Join Date: August 20, 2012

Recent Posts

Hello there,

In a velocity template wich define the layout of a results list, I am using Ajax in order to fetch several JournalArticle (of a particular structure) to include in the results list.
These JournalArticle have 2 different templates : one for the result list and another for the detailed page of the JournalArticle.

For the list, I call ('x' times) the following in a javascript tag :
1 jQuery.ajax({
2        url: "/c/journal/view_article_content?groupId=" + groupId + "&articleId=" + articleId + "&version=" + lastVersion + "&p_p_state=exclusive",
3        success: function(data) {
4            article = data;
5            //jQuery('#content').html(data);
6        },
7        async: false
8    });


This call always uses the default template associated to the Journal Article. If I specify a templateId parameter, there is no change, it's always the default template.

Let see the struts action in the javadoc : ViewArticleContentAction
If I add a "cmd=preview" parameter, I face a XML error : end of file at line -1.

I have also tried to use this kind of URL (using journal-content-firendly-url-routes.xml) :
<domain>:<port>/web/guest/home/-/journal_content/56/10180/ART001/11006
56 -> ?
10180 -> groupId
ART001 -> articleId
11006 -> templateId

But it does not work!

What can I do to specify the templateId in my Ajax call ?


Thank you.
Edouard
Edouard Perr
RE: Specify a templateId in /c/journal/view_article_content Action
November 19, 2012 1:09 AM
Answer

Edouard Perr

Rank: Junior Member

Posts: 30

Join Date: August 20, 2012

Recent Posts

Any idea? Still not resolved.
Edouard Perr
RE: Specify a templateId in /c/journal/view_article_content Action
November 26, 2012 1:09 AM
Answer

Edouard Perr

Rank: Junior Member

Posts: 30

Join Date: August 20, 2012

Recent Posts

Pleeease!
I am still on this.
Do not say me that it is not possible! What is the aim of template if I can't choose which one I want to use...

Thanks for help!