$query = $modx->newQuery('tampa'); $query->sortby('listings');
foreach($listings as $listing) { $fields = $listing->toArray(); $output .= $modx->getChunk('listings_display_chunk', $fields);
if (checkmark //not sure how to call a column name here from the db, I think this is where I am stuck == '1') { $checkfield = '<img src="check.png" />; } else { $checkfield = ' '; }
This question has been answered by Bruno17. See the first response.
foreach ($listings as $listing) { $fields = $listing->toArray(); if ($listing->get('checkmark') == '1') { $fields['checkfield'] = '<img src="check.png" />'; } else { $fields['checkfield'] = ''; } $output .= $modx->getChunk('listings_display_chunk', $fields); }
[[migxLoopCollection? &packageName=`yourPackage` &classname=`tampa` &sortConfig=`[{"sortby":"listings"}]` &tpl=`listings_display_chunk` ]]
[[+checkfield:is=`1`:then=`<img src="check.png" />`:else=``]]