We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39548
    • 10 Posts
    I am using [[*_template_style]] to switch between sidebar, home and full width template, the [[*content]] is in all three of them.
    The html code displays the content properly, however when i was looking at the $modx->log(), i noticed that my snippet on the resource page was being accessed 3x. I soon realized by removing the other two [[*content]] it solved my probem, im guessing the other solution would be to only have one content variable and to have three header and three footer like pieces of code wrapped around the content.



    Template...
        [[*_template_style:is=`Sidebar`:then=`
        	<!-- page content -->
        	<div class="[[+main_class]]" id="main" role="main">
        		<div class="column-wrapper  " >
        			[[*id:isnot=`1`:then=`<div class="hidden-xs">[[Breadcrumbs? &currentAsLink=`0` &titleField=`description` &titleField=`menutitle`]]</div>`]]
        			[[*content]]
        	   </div>
        	</div>   
        	<!-- sidebar -->
        	<div class="[[+sidebar_class]]" id="sidebar" style="padding-right: 0;" >		
        		<div class="column-wrapper" >
    				<div class="sidebar ">
    					[[$_sidebar_navigation? &config=`[[+g_sidebar_config]]` &enable=`[[*_sidebar_navigation]]`]]
    					[[*_sidebar]]
    				</div>
        			<div class="sticky hidden-sm hidden-xs "  style="min-width: 166px">[[*sidebar_sticky]]</div>
        		</div>                
        	</div>   
        `]]
        [[*_template_style:is=`Full`:then=`
        	  <!-- page content -->  
        	<div class="col-sm-12 " id="main" role="main">
        		<div class="nosidebar column-wrapper" >
        			[[*id:isnot=`1`:then=`<div class="hidden-xs">[[Breadcrumbs? &currentAsLink=`0` &titleField=`description`]]</div>`]]
        			[[*content]]
        	   </div>
        	</div>  
         
        `]]
        [[*_template_style:is=`Home`:then=`
        	  <!-- page content -->
        	<div class="col-sm-8" id="main-home" role="main">
        		<div class="column-wrapper  " >
        			[[*id:isnot=`1`:then=`<div class="hidden-xs">[[Breadcrumbs? &currentAsLink=`0` &titleField=`description` &titleField=`menutitle`]]</div>`]]
        			[[*content]]
        		</div>
        	</div>   
        	<!-- sidebar -->
        	<div class="col-sm-4" id="sidebar-home" >
        		<div class="column-wrapper" >
    				<div class="sidebar">
        			[[*_sidebar]]
    				</div>
        		</div>                
        	</div>  
        
        `]]