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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Custom Search


Reply

6 Posts   2513 Views

Avatar
Alan Tucker

5 June 2009 at 3:36am Community Member, 5 Posts

I have extended a cms page with four fields and finding its difficult to create a custom search which only searches these fields. Does any have any ideas or examples of a simple and easy implementation of a custom search?

Thanks in advance

Alan

Avatar
Hamish

5 June 2009 at 4:05pm (Last edited: 5 June 2009 4:05pm), Community Member, 712 Posts

Have a look at search contexts:

[url]http://doc.silverstripe.org/doku.php?id=searchcontext[/url]

Avatar
klikhier

28 July 2009 at 8:34pm (Last edited: 28 July 2009 8:34pm), Community Member, 150 Posts

With regards to [url]http://doc.silverstripe.org/doku.php?id=searchcontext[/url]:

Is there a way to set up SearchContext to search through more than one attribute, but WITHOUT creating a search field for every searchable attribute in the searchform. I would like to have just one search form input field that searches through 3 attributes using the SearchContext functionality.

Happy to hear!

Avatar
robinp

17 September 2009 at 6:50pm Community Member, 33 Posts

Hi klikhier,

Just wondering if you figured this out ?

Cheers

Robin

Avatar
klikhier

17 September 2009 at 10:52pm Community Member, 150 Posts

Nope, unfortunately...

Avatar
robinp

17 September 2009 at 10:58pm Community Member, 33 Posts

Hi,

Actually thought more about what I'm trying to do and what you might want to do as well and I think more standard DataObject search is the way to go. SearchContext is easy but doesn't seem that flexible

Cheers

Robin