That’s how portal_normal.vm looks by default, copied directly from the classic theme. Note the blue text below, under the ## CONTENT comment. That is where the inclusion of /html/portal/layout.jsp ($content_include) happens – where the jsp is invoked that outputs the “guts” of the page.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> #parse ($init) <html dir="#language ("lang.dir")" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>$the_title - $company_name</title> $theme.include($top_head_include) </head> <body class="$css_class"> $theme.include($top_messages_include) <div id="wrapper"> <div id="banner"> <h1 class="logo"> <a class="png" href="$company_url">$company_name</a> <span class="current-community"> $community_name </span> </h1> #parse ("$full_templates_path/dock.vm") #if ($update_available_url) <div class="popup-alert-notice"> <a class="update-available" href="$update_available_url">#language ("updates-are-available-for-liferay")</a> </div> #end </div> #if ($has_navigation) #parse ("$full_templates_path/navigation.vm") #end ## CONTENT #if ($selectable) $theme.include($content_include) #else $portletDisplay.recycle() $portletDisplay.setTitle($the_title) $theme.wrapPortlet("portlet.vm", $content_include) #end <div id="footer"></div> </div> </body> $theme.include($bottom_include) </html>portal_normal.vm
By moving this block further up the page and capturing the output (as shown below), we gain the following benefits. First, any request attributes set by the portlets (or other filters) can be obtained and used for processing in the page. Second, using the Util classes available in Velocity (see VelocityVariables.java), we can manipulate the string of content as we see fit – or eliminate it all together. This is good for cleaning and stripping out HTML, etc.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> #parse ($init) ## CONTENT ## JSP Contains: request.setAttribute("attributeTest", "Attribute Test Successful"); #if ($selectable) #set ($content = $theme.include($content_include)) #else $portletDisplay.recycle() $portletDisplay.setTitle($the_title) #set ($content = $theme.wrapPortlet("portlet.vm", $content_include)) #end #set ($myAttribute = $request.getAttribute("attributeTest")) <html dir="#language ("lang.dir")" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>$the_title - $company_name</title> $theme.include($top_head_include) </head> <body class="$css_class"> $theme.include($top_messages_include) <div id="wrapper"> <div id="banner"> <h1 class="logo"> <a class="png" href="$company_url">$company_name</a> <span class="current-community"> $community_name </span> </h1> #parse ("$full_templates_path/dock.vm") #if ($update_available_url) <div class="popup-alert-notice"> <a class="update-available" href="$update_available_url">#language ("updates-are-available-for-liferay")</a> </div> #end </div> #if ($has_navigation) #parse ("$full_templates_path/navigation.vm") #end ## CONTENT $content <div id="footer"></div> </div> </body> $theme.include($bottom_include) </html>portal_normal.vm

