<div id="post-[[+id]]" class="post-[[+id]] post hentry category-latest-news tag-tag3 tag-tag5 tag-tag7"> <div class="post-top"> <div class="post-date"><span class="day">[[+publishedon:strtotime:date=`%d`]]</span> <span class="month">[[+publishedon:strtotime:date=`%b`]]</span> <span class="year">[[+publishedon:strtotime:date=`%Y`]]</span></div> <h4><a title="Permanent Link to [[+pagetitle]]" href="[[~[[+id]]]]" rel="bookmark">[[+pagetitle]]</a></h4> </div> <div class="entry"><a href="[[~[[+id]]]]"><img class="alignleft" title="[[+tv.news_image_title]]" src="[[+tv.news_image]]" alt="" width="610" height="380" /></a> [[+content:ellipsis=`350`]] <a class="more-link" href="[[~[[+id]]]]">Read the rest of this entry »</a></div> <div class="postmetadata">Tags: [[!MyTags? &tags=`[[*tags]]` &target=`19`]]</div> </div>
<?php
/* MyTags snippet */
$tags = $modx->getOption('tags', $scriptProperties, '', true);
$target = $modx->getOption('target', $scriptProperties, '0', true);
if (empty($tags)) {
return '';
}
$fields = array(
'tags' => $tags,
'tagKey' => 'tags',
'target' => $target,
);
return $modx->runSnippet('tolinks', $fields);<div class="postmetadata">Tags: </div> </div>
[[+tv.tags]]
<div id="post-[[+id]]" class="post-[[+id]] post hentry category-latest-news tag-tag3 tag-tag5 tag-tag7"> <div class="post-top"> <div class="post-date"><span class="day">[[+publishedon:strtotime:date=`%d`]]</span> <span class="month">[[+publishedon:strtotime:date=`%b`]]</span> <span class="year">[[+publishedon:strtotime:date=`%Y`]]</span></div> <h4><a title="Permanent Link to [[+pagetitle]]" href="[[~[[+id]]]]" rel="bookmark">[[+pagetitle]]</a></h4> </div> <div class="entry"><a href="[[~[[+id]]]]"><img class="alignleft" title="[[+tv.news_image_title]]" src="[[+tv.news_image]]" alt="" width="610" height="380" /></a> [[+content:ellipsis=`350`]] <a class="more-link" href="[[~[[+id]]]]">Read the rest of this entry »</a></div> <div class="postmetadata">Tags: [[!MyTags? &tags=`[[+tv.tags]]` &target=`19`]]</div> </div>
[[+tags]]
<div class="postmetadata">Tags: [[+tv.tags]]</div> </div>
[[!getPage@newsPaging? &elementClass=`modSnippet` &element=`getResources` &showHidden=`1` &tpl=`newsTpl` &limit=`2` &includeContent=`1` &includeTVs=`1` &processTVs=`1` &parents=`[[*id]]` &hideContainers=`1` &pageLimit=`5` &pageNavVar=`page.nav` ]]
<div class="postmetadata">Tags: [[!MyTags? &tags=`[[+tv.tags]]` &target=`19`]]</div>
<div class="postmetadata">Tags: [[!MyTags? &tags=`[[+id]]` &target=`19`]]</div>
<?php
/* MyTags snippet */
$tvId = 12; // Change this to the ID of your tags TV
$docId = $modx->getOption('id', $scriptProperties, '', true);
$target = $modx->getOption('target', $scriptProperties, '0', true);
if (empty($docId)) {
return 'No doc Id';
}
$tvObj = $modx->getObject('modTemplateVar', $tvId);
if ($tvObj) {
return 'No Such TV';
}
$tags = $tvObj->renderOutput($docId);
$fields = array(
'tags' => $tags,
'tagKey' => 'tags',
'target' => $target,
);
return $modx->runSnippet('tolinks', $fields);