In response to a Liferay post, I thought I would turn my attention from themes to layouts. The following shows several different techniques that can be applied across a number of Liferay components.
#set ($contextName = '/special-layouttpl')
#set ($layoutContext = $request.getAttribute("CTX").getContext($contextName))
#evaluate ($theme.include($layoutContext, "/reusable.vm"))
## Rest of layout functions as normal
$processor.processColumn('column-1')
We must obtain a reference to the context of THIS layout. The contextName is (usually) equal to the name of the war being deployed, NOT the name of the specific layout template. Said differently, a layout war can contain more than one layout template, but each layout template in that war belongs to the same war context.
If the war is named special-layouttpl-5.2.0.1.war, then the contextName is “/special-layouttpl”. In the example above, reusable.vm is in the root path of the /special-layouttpl folder, a sibling of the .tpl files.
Mixing the technique shown above with $saxReaderUtil and $journalContentUtil will create mind-blowing potential. Cloud based themes and layouts are now possible.

