Jump to:

3448 Posts in 1062 Topics by 738 members

Data Model Questions

SilverStripe Forums » Data Model Questions » search form result, display image

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

Page: 1
Go to End
Author Topic: 1148 Views
  • snaip
    Avatar
    Community Member
    180 Posts

    search form result, display image Link to this post

    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 ?

  • snaip
    Avatar
    Community Member
    180 Posts

    Re: search form result, display image Link to this post

    ???

    1148 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.