We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23509
    • 1 Posts
    Hello All,

    This is probably really simple but I’ve been at it for hours now and searched countless times and cannot find a solution! I am using Modx Revolution and I cannot seem to get the content of the chunk to output.

    I have a template that calls a snippet called pageLayout using this code:
    [[$pageHeader]]  
    	<div id="slider-wrapper">
    		<div id="slider" class="nivoSlider">
                    	<img src="assets/images/general/22.jpg" alt="" />
                    	<img src="assets/images/general/27.jpg" alt="" />
                    	<img src="assets/images/general/31.jpg" alt=""/>
    		</div>
            </div>
    [[pageLayout]]
    [[$pageFooter]]


    The snippet is made up of this code and calls one of 3 chunks depending on what page it is on:
    <?php
    $current_docid = $modx->documentIdentifier;
    
    if (( $current_docid == 8 )||( $current_docid == 9 )||( $current_docid == 50 )||( $current_docid == 10 )||( $current_docid == 49 )||( $current_docid == 51 )) {
    	$output = $modx->getChunk('modChunk',array(  
    		'name' => 'twoColumnSideBar'  
    	));
    } elseif ( $current_docid == 1 ){
    	$output = $modx->getObject('modChunk',array(  
    		'name' => 'threeColumnLayout'  
    	));
    } else {
    	$output = $modx->getObject('modChunk',array(  
    		'name' => 'oneColumnLayout'  
    	));
    }
    return $output;


    This is an example of the chunk named threeColumnLayout:
    <div id='content'>
    	<div id='column1'>
    		[[*content]]
    	</div>
    	<div id='column2'>
    		<h2>Testimonials</h2>
    	</div>
    	<div id='column3'>
    		<h2>Latest News</h2>
    	</div>
    </div>


    I’ve tried putting some trace in the if statements and the are executing correctly but I am getting nothing out of these statements in the snippet:
    $output = $modx->getObject('modChunk',array(  
    	'name' => 'threeColumnLayout'  
    ));