Jump to:

22977 Posts in 11806 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Customize Search Fields

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

Page: 1
Go to End
Author Topic: 1483 Views
  • MDrollette
    Avatar
    Community Member
    10 Posts

    Customize Search Fields Link to this post

    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.

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Customize Search Fields Link to this post

    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

  • AlaVive
    Avatar
    Community Member
    42 Posts

    Re: Customize Search Fields Link to this post

    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.

    1483 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.