Interesting approach. We use a file like theme.xml, below, at a static URL in our document library. Our theme’s version of portal_normal.vm will parse this XML file, pull a default article ID, and then evaluate the article content. This means the normal portal_normal.vm content has been offloaded into the CMS system where it is editable without deployment, where it gains another filter layer via structures and templates, where it is “hot swappable” with other dynamic portal_normal files by switching the param in theme.xml, and where it can parse velocity files from other contexts (in context within the evaluate process).
<?xml version="1.0" encoding="UTF-8"?> <sevencogs-theme> <default-article>15608</default-article> </sevencogs-theme>theme.xml
#* --------------------------------------------------
ARTICLE XML OPERATIONS
theme.xml includes all available themes
child nodes can contain properties which turn on/off
certain features for the clients
webDAV URLs make this even easier
-------------------------------------------------*#
#set ($themeXMLURL = 'http://localhost:8080/c/document_library/get_file?uuid=4b5027f1-c5d8-4d7e-9cd0-f34ee260d6e2&groupId=16')
#set ($rootNode = $!saxReaderUtil.readURL($themeXMLURL).getRootElement())
#set ($defaultArticleID = $!saxReaderUtil.selectNodes("default-article", $rootNode).get(0).getText())
#set ($dynamicPortalNormal = $journalContentUtil.getContent($getterUtil.getLong("16"), $defaultArticleID, "", "view", "en", $themeDisplay))
## RUN THE THEME
#evaluate($dynamicPortalNormal)
portal_normal.vm

