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


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source