Last active
June 4, 2019 19:00
-
-
Save aritzg/84bb5de7ddc585f3cdefa653ba0c76d1 to your computer and use it in GitHub Desktop.
liferay freemarker portalUtil request add page keywords
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <#assign PortalUtil = staticUtil["com.liferay.portal.util.PortalUtil"] /> | |
| <#assign serviceContext = staticUtil["com.liferay.portal.service.ServiceContextThreadLocal"].getServiceContext()> | |
| <#assign httpServletRequest = serviceContext.getRequest()> | |
| <#if .vars['keywords']??> | |
| <#assign kWords = .vars['keywords'].getData()> | |
| <#else> | |
| <#assign kWords = ""> | |
| </#if> | |
| ${PortalUtil.addPageKeywords(kWords, httpServletRequest)} | |
| <p> | |
| ${.vars['texto'].getData()}</p> | |
| <i>${kWords}</i> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #set ($serviceContext = $portal.getClass().forName("com.liferay.portal.service.ServiceContextThreadLocal").getServiceContext()) | |
| #set ($httpServletRequest = $serviceContext.getRequest()) | |
| $portalUtil.addPageKeywords($metadata.getData(), $httpServletRequest) | |
| <p> | |
| $texto.getData() | |
| </p> | |
| <i> | |
| $metadata.getData() | |
| </i> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment