Forums de discussion
WebContent velocity template - a couple of questions
Dmitry Sergeev, modifié il y a 11 années.
WebContent velocity template - a couple of questions
Junior Member Publications: 34 Date d'inscription: 08/11/11 Publications récentes## The variable $viewMode specifies which mode the article is being viewed in.
## For example, if $viewMode evaluates to "print", that means the user clicked
## the print icon to view this article.
Where can I find other possible values for viewMode?
I need to distinguish between abstract and full content views.
And another question is, how can I get article author from within velocity template?
Subhasis Roy, modifié il y a 11 années.
RE: WebContent velocity template - a couple of questions
Expert Publications: 275 Date d'inscription: 20/01/12 Publications récentes
These are called theme variables specifies in the WebKeys. You can write you own custom variables and access then in your vm file
check the following links
http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/lp-6-1-dgen05-available-variables-0
http://content.liferay.com/4.3/misc/theme-api-4.3.0.html
check the following links
http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/lp-6-1-dgen05-available-variables-0
http://content.liferay.com/4.3/misc/theme-api-4.3.0.html
Dmitry Sergeev, modifié il y a 11 années.
RE: WebContent velocity template - a couple of questions
Junior Member Publications: 34 Date d'inscription: 08/11/11 Publications récentes
First of all, those links you posted are relevant for theme development only. You will be surprised how different are contexts in defferent places where velocity templates appear.
I couldn't find any information about what variables are available in WebContents template. I need something like $reserved_record_set_id variable, which is available in display template for Dynamic DataList.
I couldn't find any information about what variables are available in WebContents template. I need something like $reserved_record_set_id variable, which is available in display template for Dynamic DataList.
Dmitry Sergeev, modifié il y a 11 années.
RE: WebContent velocity template - a couple of questions
Junior Member Publications: 34 Date d'inscription: 08/11/11 Publications récentes
You can find a list of valiables in com.liferay.portlet.journal.util.JournalUtil class (not JournalVmUtil as you might say from docs).
reserved-article-author-id is what I was searching for:
And, I've finally found a sort of official information:
http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/CMS+Template+%28Velocity%29
It claims that there's variable named $serviceLocator in context, which is not true.
Any ideas about how to get UserLocalServiceUtil?
reserved-article-author-id is what I was searching for:
#set ($authorId = $getterUtil.getLong($reserved-article-author-id.data, 0))
And, I've finally found a sort of official information:
http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/CMS+Template+%28Velocity%29
It claims that there's variable named $serviceLocator in context, which is not true.
Any ideas about how to get UserLocalServiceUtil?
Dmitry Sergeev, modifié il y a 11 années.
RE: WebContent velocity template - a couple of questions
Junior Member Publications: 34 Date d'inscription: 08/11/11 Publications récentes
Here is an answer:
http://www.liferay.com/community/forums/-/message_boards/message/5942970
http://www.liferay.com/community/forums/-/message_boards/message/5942970