掲示板

embeded in freemaker

8年前 に abhishek kumar によって更新されました。

embeded in freemaker

Regular Member 投稿: 138 参加年月日: 15/08/17 最新の投稿
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.....!
thumbnail
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", "", "")}
7年前 に Jack Thinkin によって更新されました。

RE: embeded in freemaker

Junior Member 投稿: 45 参加年月日: 16/05/09 最新の投稿
what is right syntax for theme.display() in freemaker? embedding of search in theme. is there any link for reading? thanks
thumbnail
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 />
7年前 に Jack Thinkin によって更新されました。

RE: embeded in freemaker

Junior Member 投稿: 45 参加年月日: 16/05/09 最新の投稿
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?
thumbnail
7年前 に Julien Mourad によって更新されました。

RE: embeded in freemaker

Junior Member 投稿: 78 参加年月日: 15/01/22 最新の投稿
Yes unfortunately I'm familiar with 6.2 but not 7.
7年前 に Jack Thinkin によって更新されました。

RE: embeded in freemaker

Junior Member 投稿: 45 参加年月日: 16/05/09 最新の投稿
thanks
there is description of changes in Liferay 7 in comparison to older versions in
https://dev.liferay.com/develop/reference/-/knowledge_base/7-0/breaking-changes

using of Liferay Tag <@liferay_portlet["runtime"] in FreeMarker
There are seems no changes in Velocity