简体   繁体   中英

How can it get the theme display in a Web Content template (Liferay 7.x)

I need to access the theme_display in a Liferay 7.3 Web Content Template.

I tried the following code (from Liferay Portal 6.2 - How to get theme_display in Web Content Template ) but it doesn't work (change in Liferay 7.x) I would guess.

<#assign
serviceContextThreadLocal = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"]
themeDisplay = serviceContextThreadLocal.getServiceContext().getThemeDisplay()
/>

My goal is to access the login URL dynamically. I have the following code in my theme which works, but I now need it for some specific content.

theme_display.getURLSignIn()

It should work with just ${themeDisplay.getURLSignIn()} . I used it with a dip 7.3 Also the following gist might be helpful: https://gist.github.com/bmvakili/2e83d1b73964d14d873ba5486bc28dd5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM