Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions

search form result, display image


Reply

2 Posts   1160 Views

Avatar
snaip

23 February 2010 at 8:46am Community Member, 180 Posts

hello

i have product page with
has_one {
'Img' => 'Image'
}

function results($data, $form){

if($form->getSearchQuery() == NULL) {
$data = array(
'Results' => '',
'Query' => '',
'Title' => 'Your results'
);
} else {

$data = array(
'Results' => $form->getResults(),
'Query' => $form->getSearchQuery(),
'Title' => 'Your results'
);
}

$form = new SearchForm($this, "SearchForm", $fields, $actions);
$form->classesToSearch(array('SiteTree'));
return $form;
}

but standard search form function is only searching in the SiteTree so i cant display product image
how to modify this search form function to display images ?

Avatar
snaip

26 February 2010 at 9:58am Community Member, 180 Posts

???