<?php
$c = $modx->newQuery('modDocument');
$c->where(array(
'published' => '1',
'isfolder' => '0',
'context_key' => 'news',
));
$c->sortby('publishedon', 'DESC');
$c->limit(20, 10);
$docs = $modx->getIterator('modDocument', $c, 0);
$output = '<ul>';
foreach($docs as $doc) {
$properties = $doc->toArray();
$output .= $modx->getChunk('DepartmentalNewsListItem', $properties);
}
$output .= '</ul>';
return $output;<li style="list-style-type:disc; color:#c93; list-style-position: inside"> <a href="[[!~[[+id]]]]"> [[+pagetitle]] </a> </li>
... <div id="news"> <h4 class="title">News Resources</h4> <!-- Other news related links --> [[Wayfinder? &contexts=`web` &startId=`47` &outerTpl=`NewsResourcesTpl` &cacheResults=`0`]] <!-- List of archived news --> [[!ArchivedNews]] </div> [[*content]] </div> [[$StatFooter]] [[$StatGoogleAnalytics]] </div> ...
This question has been answered by multiple community members. See the first response.
Sounds like a caching problem. From a guess, I'd say remove the exclamation mark in <a href="[[!~[[+id]]]]"> and then clear the Site's cache.</a>
<a href="[[!~[[+id]]]]">
<a href="[[!~[[*id]]]]">
@Tom;
I think you should just do [[~[[+id]]]] .. so leave the ! out.. because the chunk is parsed fresh from the source it will not be cached
[[$NewsResources]] //on my featured news page
[[!ArchivedNews]] //within the NewsResources chunk
/* <All within the ArchivedNews snippet> */
$c = $modx->newQuery('modDocument',null);
...
$docs = $modx->getIterator('modDocument', $c);
...
$output .= $modx->getChunk('DepartmentalNewsListItem', $properties);
/* </All within the ArchivedNews snippet> */
//And then the updated DepartmentalNewsListItem
[[~[[+id]]]]
<div id="news"> <h4 class="title">News Resources</h4> <!--[[!Wayfinder? &contexts=`web` &startId=`47` &outerTpl=`NewsResourcesTpl`]] --> [[!ArchivedNews]] </div>