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 /

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba

search form result, display image


Go to End
Reply


2 Posts   1399 Views

Avatar
snaip

Community Member, 180 Posts

23 February 2010 at 8:46am

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

Community Member, 180 Posts

26 February 2010 at 9:58am

???