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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Data Model Questions /

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

search form result, display image


Go to End


2 Posts   1610 Views

Avatar
snaip

Community Member, 181 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, 181 Posts

26 February 2010 at 9:58am

???