When you make a journalContentUtil call from a theme, there is no portlet request object, which means there is no serialized $xmlRequest object available to your CMS Templates. This limits the potential of articles a lot. Producing XML and accessing it directly from the theme is often useful for creating full page structures from the various nodes of the XML. But even a relatively unsophisticated template requires access to basic variables like the URL, so this gap needs to be bridged.
Here’s how. You create a faux xmlRequest object (just xml), and pass it to the CMS template as part of the journalContentUtil call.
#set ($xmlRequestPath = "$full_templates_path/xmlRequest.xml")
#set ($xmlRequest = "#parse($xmlRequestPath)")
## ARTICLE XML OPERATIONS
#set ($articleXML = $!journalContentUtil.getContent(
$getterUtil.getLong("GROUPID"),
$articleID, "", "view",
$localeUtil.toLanguageId($locale),
$themeDisplay,
$xmlRequest
))
portal_normal.vm
<request> <container-type>portlet</container-type> <container-namespace>/</container-namespace> <content-type>text/html</content-type> <server-name>$themeDisplay.getServerName()</server-name> <server-port>$themeDisplay.getServerPort()</server-port> <secure>$themeDisplay.isSecure()</secure> <auth-type /> <remote-user>$themeDisplay.getUserId()</remote-user> <context-path>/</context-path> <locale>en</locale> <portlet-mode>view</portlet-mode> <portlet-session-id></portlet-session-id> <scheme>https</scheme> <window-state>normal</window-state> <lifecycle>RENDER_PHASE</lifecycle> <portlet-namespace></portlet-namespace> <action-url></action-url> <render-url></render-url> <render-url-exclusive></render-url-exclusive> <render-url-maximized></render-url-maximized> <render-url-minimized></render-url-minimized> <render-url-normal></render-url-normal> <render-url-pop-up></render-url-pop-up> <resource-url></resource-url> <theme-display> <cdn-host /> <company-id>$themeDisplay.getCompanyId()</company-id> <do-as-user-id /> <i18n-language-id /> <language-id>en</language-id> <locale>en</locale> <path-context /> <path-friendly-url-private-group> $themeDisplay.getPathFriendlyURLPrivateGroup() </path-friendly-url-private-group> <path-friendly-url-private-user> $themeDisplay.getPathFriendlyURLPrivateUser() </path-friendly-url-private-user> <path-friendly-url-public> $themeDisplay.getPathFriendlyURLPublic() </path-friendly-url-public> <path-image>$themeDisplay.getPathImage()</path-image> <path-main>$themeDisplay.getPathMain()</path-main> <path-theme-images>$themeDisplay.getPathThemeImages()</path-theme-images> <plid>$themeDisplay.getPlid()</plid> <portal-url> $httpUtil.removeProtocol($themeDisplay.getPortalURL()) </portal-url> <real-user-id>$themeDisplay.getUserId()</real-user-id> <scope-group-id>$themeDisplay.getScopeGroupId()</scope-group-id> <secure>$themeDisplay.isSecure()</secure> <server-name>$themeDisplay.getServerName()</server-name> <server-port>$themeDisplay.getServerPort()</server-port> <time-zone>$themeDisplay.getTimeZone().getID()</time-zone> <url-portal> $httpUtil.removeProtocol($themeDisplay.getURLPortal()) </url-portal> <user-id>$themeDisplay.getUserId()</user-id> <portlet-display> <id></id> <instance-id></instance-id> <portlet-name></portlet-name> <resource-pk></resource-pk> <root-portlet-id></root-portlet-id> <title>Web Content Display</title> </portlet-display> </theme-display> <parameters /> <currenturl> $htmlUtil.escape($themeDisplay.getURLCurrent()) </currenturl> </request>xmlRequest.xml

