[[!SimpleSearch? &tpl=`search_form_row_tpl` &perPage=`6` &includeTVs=`1` &processTVs=`1` &containerTpl=`search_form_container_tpl` &pageTpl=`search_form_pageTpl` &pageNextTpl=`search_form_pageNextTpl` &pagePrevTpl=`search_form_pagePrevTpl` ¤tPageTpl=`search_form_currentPageTpl` &pagingSeparator=`` ]]
This question has been answered by Bruno17. See the first response.
Ah than that is it... How can I search MIGX TV's?You might want to follow this thread for that: http://forums.modx.com/thread/98680/custom-package-contents-and-migx-package-contents-search-using-simplesearch-extra
<?php $migxtv_templates = '3,7'; $config = '[ {"tvname":"migxtv","template":"3","target_tv":"searchMigxData","fields":[ {"field":"headline"}, {"field":"text"} ]}, {"tvname":"migxtv","template":"7","target_tv":"searchMigxData","fields":[ {"field":"headline"}, {"field":"text"} ]}, {"tvname":"othermigxtv","template":"4","target_tv":"searchMigxData","fields":[ {"field":"headline"}, {"field":"text"} ]}, {"tvname":"migxtv3","template":"5","target_tv":"searchMigxData","fields":[ {"field":"headline"}, {"field":"text"}, {"field":"headline_bundle"}, {"field":"downloads","type":"migx","fields":[ {"field":"title1"}, {"field":"title2"}, {"field":"text"} ]} ]} ]'; function jsonFieldsToArray($items, $fields) { global $modx; $output = array(); if (!is_array($items)) { $items = $modx->fromJson($items); } if (is_array($items)) { foreach ($items as $item) { foreach ($fields as $field) { $fieldname = $modx->getOption('field', $field, ''); $type = $modx->getOption('type', $field, ''); if (isset($item[$fieldname])) { if ($type == 'migx') { $subitems = $item[$fieldname]; $subfields = $modx->getOption('fields', $field, ''); $suboutput = jsonFieldsToArray($subitems,$subfields); $output = array_merge($output,$suboutput); } else { $output[] = $item[$fieldname]; } } } } } return $output; } $migxtv_templates = explode(',', $migxtv_templates); $resource_template = $resource->get('template'); if (in_array($resource_template, $migxtv_templates)) { $config = $modx->fromJson($config); foreach ($config as $cfg) { $tvname = $modx->getOption('tvname', $cfg, ''); $template = $modx->getOption('template', $cfg, ''); $fields = $modx->getOption('fields', $cfg, ''); $target_tv = $modx->getOption('target_tv', $cfg, ''); $items = $resource->getTVValue($tvname); $values = jsonFieldsToArray($items, $fields); if ($template == $resource_template){ //has the template itself - we save to that resource $resource->setTVValue($target_tv,implode("\n\n",$values)); }elseif ($target_resource = $modx->getObject('modResource',array('template'=>$template,'parent'=>$resource->get('id')))){ //otherwise search child-resource with that template $target_resource->setTVValue($target_tv,implode("\n\n",$values)); } } }
Damn will have to buy you a beer again... **mumbling whilst clicking the sponsor link**