$tv = $modx->getObject('modTemplateVar', array('name' => 'String'));
$var = $tv->renderOutput($id);
}
$val = $modx->resource->getTVValue('String');<div class="group">
<div class="box">
<a href="[[~[[+id]]]]"><img src="[[+imgSrc]]" alt="[[+pagetitle]]"/></a>
</div>
<h4>[[+pagetitle]]</h4>
<p>[[+introtext]]</p>
<a href="[[~[[+id]]]]">Link Text</a>
</div><?php
/* @var $modx modX */
$c = array(
'hidemenu' => 0,
'published' => 1,
);
$output = '';
$children = $modx->resource->getMany('Children', $c);
foreach($children as $child) {
/* @var $child modResource */
$fields = $child->toArray();
$fields['imgSource'] = $child->getTVValue('ProductImage');
$output .= $modx->getChunk('ImageListTpl', $fields);
}
return $output;<div class="group">
<div class="box">
<a href="[[~[[+id]]]]"><img src="[[+imgSrc]]" alt="[[+pagetitle]]"/></a>
</div>
<h4> <a href="[[~[[+id]]]]">[[+pagetitle]]</a></h4>
</div>
$i = 1;
$product = 'product'. $i;
while(!empty($$product) && $i < 99) {
$child = $modx->getDocument($product);
$vars = $modx->getTemplateVarOutput(array('ProductImage'), $child['id']);
?>
<div class="group">
<div class="box">
<a href="[[~<?php echo $child['id'] ?>]]"><img src="<?php echo $vars['ProductImage']; ?>" alt="<?php echo $child['pagetitle']; ?>"/></a>
</div>
<a href="[[~<?php echo $child['id'] ?>]]"><?php echo $child['pagetitle'] ?> »</a>
</div>
<?php
if (++$i % 4 != 0)
echo '<div style="width: 13px; float: left;"> </div>';
$product = 'product'. $i;
}[[SnippetName? &product1=`{PageIDnumber}` &product2=`{PageIDnumber}` &product3=`{PageIDnumber}`]]$product = $scriptProperties['product' . $i];
while(!empty($product) && $i < 99) {
$child = $modx->getObject('modResource', $product);
$tvValue = $child->getTVValue('ProductImage');
<div class="group">
<div class="box">
<a href="[[~[[+id]]]]"><img src="[[+imgSrc]]" alt="[[+pagetitle]]"/></a>
</div>
<h4> <a href="[[~[[+id]]]]">[[+pagetitle]]</a></h4>
</div>
<?php
/* @var $modx modX */
$c = array(
'hidemenu' => 0,
'published' => 1,
);
$output = '';
$children = $modx->resource->getMany('Children', $c);
$i = 1;
foreach($children as $child) {
/* @var $child modResource */
$product = $scriptProperties['product' . $i];
while(!empty($product) && $i < 99) {
$child = $modx->getObject('modResource', $product);
$tvValue = $child->getTVValue('ProductImage');
$output .= $modx->getChunk('ThreeImgChunk', $tvValue);
if (++$i % 4 != 0)
echo '<div style="width: 13px; float: left;"> </div>';
$product = 'product'. $i;
}
}
return $output;[[RelatedProducts? &product1=`5` &product2=`10` &product3=`40`]]
<?php
/* @var $modx modX */
$c = array(
'hidemenu' => 0,
'published' => 1,
);
$output = '';
$children = $modx->resource->getMany('Children', $c);
foreach($children as $child) {
/* @var $child modResource */
$fields = $child->toArray();
$fields['imgSource'] = $child->getTVValue('ProductImage');
$output .= $modx->getChunk('ImageListTpl', $fields);
}
return $output;'placholdername' => 'value',