CMS 速度テンプレートで現在のページのタイトルを取得するにはどうすればよいですか?
ブレッドクラムの最後の部分、つまりページ タイトルに示されているのと同じ文字列が必要です。
最後に、私はそれを行う方法を見つけました。$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))
それでおしまい。
テーマ テンプレート:$page.getHTMLTitle($locale)
CMSテンプレートから、答えを得るためにもう少し深く掘り下げる必要があります...テーマが十分かどうか教えてください
larrytron コードに加えて、この行を portal-ext.properties で宣言して、CMS テンプレートで制限された変数を使用すると便利です
journal.template.velocity.restricted.variables=