掲示板
embeded in freemaker
hello all,
i have created a theme using freemaker and styled..how to embeded mine portlet in freemaker...
as i am putting $theme.runtime("-portletid");
but it is not working i guess it works only on portal_normal.vm.....!
i have created a theme using freemaker and styled..how to embeded mine portlet in freemaker...
as i am putting $theme.runtime("-portletid");
but it is not working i guess it works only on portal_normal.vm.....!
8年前 に Julien Mourad によって更新されました。
RE: embeded in freemaker (回答)
Junior Member 投稿: 78 参加年月日: 15/01/22 最新の投稿
$theme.runtime() is velocity syntax and not freemarker. Use ${theme.runtime("portletId", "", "")}
what is right syntax for theme.display() in freemaker? embedding of search in theme. is there any link for reading? thanks
7年前 に Julien Mourad によって更新されました。
RE: embeded in freemaker
Junior Member 投稿: 78 参加年月日: 15/01/22 最新の投稿Jack Thinkin:
what is right syntax for theme.display() in freemaker? embedding of search in theme. is there any link for reading? thanks
I believe the most common approach to embed a portlet in a theme is ${theme.runtime()} while adding the portlet id as parameter. The portlet id for the search is 3, alternatively you can simply use ${theme.search()} instead if you don't have any preferences. https://dev.liferay.com/ should help you find whatever you're looking for.
As for the theme display in a theme, you can simply use theme_display. This is declared in init.ftl:
<#assign theme_display = themeDisplay />
thanks.
i get exceptions in Liferay 7 during trial to call ${theme.search()} or ${theme.runtime("3")} like:
..
If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
...
FTL stack trace ("~" means nesting-related): Failed at: ${theme.search()}
Object theme is no null
Do You mean older versions of Liferay?
i get exceptions in Liferay 7 during trial to call ${theme.search()} or ${theme.runtime("3")} like:
..
If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
...
FTL stack trace ("~" means nesting-related): Failed at: ${theme.search()}
Object theme is no null
Do You mean older versions of Liferay?
7年前 に Julien Mourad によって更新されました。
RE: embeded in freemaker
Junior Member 投稿: 78 参加年月日: 15/01/22 最新の投稿
Yes unfortunately I'm familiar with 6.2 but not 7.