<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> [[$MetaHeaders]] <!-- calls a chunk of static html --> [[$ScriptHeaders]] <!-- calls some common js --> [[!If? &subject=`[[*LoadFlowPlayer]]` &operator=`eq` &operand=`true` &then=`[[$FlowplayerJS]]` ]] <!-- calls more js if flowplayer TV is set --> [[!*PPEnableScripts:is=`true`:then=`[[$PowerPointHeaders]]`]] <!-- calls more js if PowerPoint scripts are set --> [[$GoogleTranslate]] <!-- google translate code & js --> [[$GoogleAnalytics]] <!-- google analytics code --> </head> <body> <div id="viewport" class="[[*ContentSection]]"> <div id="log-in-bar"> <!-- calls the login stuff --> [[!Login? &tplType=`modChunk` &preHooks=`ReturningUserAgreeToEULA` &loginTpl=`lgnCustomHeaderFormTpl` &logoutTpl=`lgnCustomLogoutTpl` &logoutResourceId=`216` &loginResourceId=`0`]] </div> <div id="header"> <div id="logo"><a href="/" ><img src="/assets/images/transparent.gif" height="117" width="243" border="0" /></a></div> <div id="banner"></div> </div> <div id="main-navigation"> <!-- navigation --> [[Wayfinder? &debug=`0` &startId=`0` &level=`3` &displayStart=`1` &outerTpl=`MainOuterTpl` &rowTpl=`MainRowTpl` &parentRowTpl=`MainParentRow` &cacheResults=`1`]] </div> <div id="breadcrumbs"> <!-- breadcrumbs --> [[Breadcrumbs? &crumbSeparator=`>` ¤tAsLink=`false` &titleField=`longtitle` &showCrumbsAtHome=`0`]] </div> <!-- if this is the homepage, display the newsticket ~ calls getResources whch calls 2 more chunks --> [[If? &subject=`[[*id]]` &operator=`==` &operand=`1` &then=`[[$ShowSlider]][[!$VerticalTicker]]`]] <div id="main-content"> <div id="left-content"> <!-- this TV can call one of several chunks: Show Title & Date Info==[[!$ShowFullPageTitle]]||Show Title Only==[[!$ShowOnlyTitle]]||Do Not Show Title==[[$ShowNoTitle]] --> [[*ShowTitle]] <!-- content --> [[*content]] <!-- the PowerPointPageContent chunk will call get resources + gallery + several other chunks --> [[!*PPEnableScripts:is=`true`:then=`[[$PowerPointPageContent]]`]] <!-- if polls were enabled, will show poll feedback --> [[*FeedbackID:notequalto=`0`:then=`[[$ShowPollFeedback]]`]] <!-- enable polls or not --> [[*allowComments]] </div> <div id="right-content"> <!-- calls getresources which calls at least 2 other chunks [wrappper & row tpls] --> [[!ShowOncologistSearch]] <!-- if set calls getresources which calls at least 2 other chunks [wrappper & row tpls] --> [[*CalloutPositionOne]] <!-- if set calls getresources which calls at least 2 other chunks [wrappper & row tpls] --> [[*CalloutPositionTwo]] <!-- if set calls getresources which calls at least 2 other chunks [wrappper & row tpls] --> [[*CalloutPositionThree]] <!-- if set calls getresources which calls at least 2 other chunks [wrappper & row tpls] --> [[*CalloutPositionFour]] <!-- if set calls getresources which calls at least 2 other chunks [wrappper & row tpls] --> [[*CalloutPositionFive]] </div> </div> <div id="footer"> <div id="footer-wrapper"> <div id="footer-navigation"> <!-- calls a chunk of static html --> [[$FooterNavigation]] </div> <div id="footer-extras"> <!-- more static html --> [[!$FooterExtras]] </div> <!-- chunk showing debug times --> [[!$ShowDebugTime]] </div> </div> </div> </body> </html>
(yeah, easier said than done!)
You're doing more tedious things than I'm used to but right off what if you make a single chunk for the entire head section instead of calling 6 per template?
It definitely gives me some new ideas and I'm glad you posted this. The way you implement it helps me, and others, advance our MODX usage.
[[!If? &subject=`[[*LoadFlowPlayer]]` &operator=`eq` &operand=`true` &then=`[[$FlowplayerJS]]` ]] <!-- calls more js if flowplayer TV is set -->
[[[[If? &subject=`[[*LoadFlowPlayer]]` &operator=`eq` &operand=`true` &then=`$FlowplayerJS`]]]]
[[!*PPEnableScripts:is=`true`:then=`[[$PowerPointHeaders]]`]]
<!-- if this is the homepage, display the newsticket ~ calls getResources whch calls 2 more chunks -->
[[If? &subject=`[[*id]]` &operator=`==` &operand=`1` &then=`[[$ShowSlider]][[!$VerticalTicker]]`]]<!-- this TV can call one of several chunks: Show Title & Date Info==[[!$ShowFullPageTitle]]||Show Title Only==[[!$ShowOnlyTitle]]||Do Not Show Title==[[$ShowNoTitle]] -->
[[*ShowTitle]][[!*PPEnableScripts:is=`true`:then=`[[$PowerPointPageContent]]`]]
<!-- calls getresources which calls at least 2 other chunks [wrappper & row tpls] -->
[[!ShowOncologistSearch]]<!-- more static html -->
[[!$FooterExtras]][[!*PPEnableScripts:is=`true`:then=`[[$PowerPointPageContent]]`:else=``]]
true==[[$PowerPointPageContent]]||false==
[[*PPEnableScripts]]
This TV-tag should be cached, if possible.To emphasize that, there's no reason I can think of in regular usage to have TV or resource fields tags uncached.