<?php
$pageId = isset($pageId) ? $pageId : $modx->documentIdentifier;
$pid = $modx->getParent($pageId);
switch ($pid) {
case '15':
return $modx->getChunk('firsts-league');
break;
case '67':
return $modx->getChunk('seconds-league');
break;
}
return $modx->getChunk('firsts-league');
?><div id="sidebar"> !GetSidebar?&pageId=`[*id*]`!] </div>
<?php
$pageId = isset($pageId) ? $pageId : $modx->documentIdentifier;
$pid = $modx->getParent($pageId);
switch ($pid) {
case '15':
return $modx->getChunk('firsts-league');
break;
case '67':
return $modx->getChunk('seconds-league');
break;
}
return $modx->getChunk('firsts-league');
?><div id="sidebar">[!GetSidebar? &pageId=`[*id*]`!]</div>

<?php
$output = '<br>In Snippet<br>';
$pageId = isset($pageId) ? $pageId : $modx->documentIdentifier;
$ouput .= '<br>pageId: ' . $pageId;
$pid = $modx->getParent($pageId);
$output .= '<br>Parent ID: ' . $pid . '<br>';
switch ($pid) {
case '15':
$output .= $modx->getChunk('firsts-league');
break;
case '67':
$output .= $modx->getChunk('seconds-league');
break;
default:
$output .= 'Not Found';
}
$output .= '<br'>
return $output;
?>
Not sure if it would make a difference but are the pages your doing this on cached ??
If so edit the pages and take the tick out of cacheable and clear the site cache.
Quote from: paulp at Aug 25, 2009, 06:45 PM
Not sure if it would make a difference but are the pages your doing this on cached ??
If so edit the pages and take the tick out of cacheable and clear the site cache.
Since the snippet is uncached, I think the pages should be cached. It’s my understanding that in Evo, an uncached snippet in an uncached page becomes cached, but I could have it wrong.
