2013-04-30 48 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= 
相關問題