Scott McIntosh
Scott McIntosh

Reputation: 151

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()

Upvotes: 2

Views: 862

Answers (1)

Andre Albert
Andre Albert

Reputation: 1394

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

Upvotes: 3

Related Questions