2013-04-30 81 views

回答

2

最后,我发现了如何去做吧。 因此有必要通过$ themeDisplay

##Take layout id 
#set ($layoutId = $request.get("theme-display").get("plid")) 

## get the service for layout 
#set($layoutService = $serviceLocator.findService("com.liferay.portal.service.LayoutLocalService")) 

##convert the layout id into long 
#set ($layoutLong = $getterUtil.getLong($layoutId)) 

##take a layout object 
#set($layout = $layoutService.getLayout($layoutLong)) 
#set ($pageName = $layout.getName($locale)) 

就是这样来访问。

+0

包含参考:https://sushilsaini.wordpress.com/2014/12/15/liferay-embed-the-page-title-in-layout-template/ – Dan 2017-05-15 03:34:05

1

在主题模板:$page.getHTMLTitle($locale)

从CMS模板我要挖一个深一点的答案...让我知道,如果主题是足够

+0

还是要谢谢你,但我需要的只是在CMS模板。 – larrytron 2013-04-30 10:25:17

1

除了与larrytron代码,这是有用的portal-ext.properties在CMS模板使用限制变量声明此行

journal.template.velocity.restricted.variables= 
相关问题