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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Customize Search Fields


Go to End


3 Posts   2355 Views

Avatar
MDrollette

Community Member, 10 Posts

4 November 2009 at 3:16am

I'm trying to use SilverStripe as a listing/search for car parts at a scrap yard. I'm new to SilverStripe for this kind of application so I'd like to know the proper way to model this.

Each part has a make and model of the car it belongs to. I have these stored as relations to Make and Model objects so the client can add/remove new makes/models. I want people to be able to filter makes and models with the drop down in the search form on the frontend but I can't seem to find a way to modify the search form fields for a related object to be anything beyond a text input. I've noticed that db fields of type Enum behave this way (with a dropdownfield) but an Enum is clumsy when I have 100's of models to list.

Avatar
dalesaurus

Community Member, 283 Posts

5 November 2009 at 6:38pm

There are many search types available, it really depends on how you want to filter them.

If you want to get fancy, create a search context to get very specific
http://doc.silverstripe.org/doku.php?id=searchcontext

You can work people up to their search by stepping them up
1. Ask for make
2. Store make in sessoin
3. If Make is set, present dropdown for Model
4. repeat

Avatar
AlaVive

Community Member, 42 Posts

6 November 2009 at 10:18am

Please forgive me for sounding needy, but I'm interested to see how you get this working. I just started an attempt to create a search using search context (http://silverstripe.org/general-questions/show/272699?showPost=272699), but I am lost on how to continue. Your solution can either help or address yet another type of search I need to implement on my current project.