2

Liferay动态数据列表中的列表模板

我已经阅读了这篇文章以及另一篇 webapplicationdeveloper 博客文章,但没有找到任何将自定义应用模板中的操作按钮获取到动态数据列表的想法。

我也尝试在 vm 模板中包含 dynamicdatalist portlet 的默认 record_action.jsp 但它不起作用并且还设置了下面的属性

journal.template.velocity.restricted.variables = 

portal-ext 属性中,但我仍然没有在我的自定义模板中获得操作按钮

我已经尝试过了:

#
set (
$categoriesService = $portal.getClass().forName("com.liferay.portlet.asset.service.AssetCategoryLocalServiceUtil").getMethod("getService", null).invoke(null, null))

My answer is: Yessss, it works. But I want use a jstl lib (e.g. <aui> or <ui>) as well. In my opinion the simpliest way to do it is include jsp file to themeServletContext. Put your file.jsp into your theme:

your-theme/docroot/path/to/your/jsp/file.jsp

and paste this piece of code into your vm (for example portal_normal.vm):
$theme.include($themeServletContext, "/path/to/your/jsp/file.jsp")

在这种情况下,它无法找到我的页面显示$theme的 $theme 变量...:(请帮助:

4

1 回答 1

1

Leave velocity, it's too poor to use taglib, and switch to freemaker language: more powerfull and full support of taglib.

Here there is an example to use freemaker for theme develment, but it's good starting point also to template in dynamic data list.

https://www.liferay.com/it/web/mika.koivisto/blog/-/blogs/using-freemarker-in-your-theme-templates

Look also freemaker guide: http://freemarker.org/docs/index.html

于 2014-01-04T18:48:48.133 回答