ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search module: keyword wildcard?

August 10, 2011 1:34pm

Subscribe [3]
  • #1 / Aug 10, 2011 1:34pm

    Brian M.

    529 posts

    This question may be related to a resolved thread.

    I had a similar question to this poster - I want to use a search form as a filter for a channel, so I would like the keyword field to be optional.  Is it possible to do this? Maybe a wildcard for the keyword?  So in the attached screenshot the ‘name’ field would be optional:

    Thanks for the help!

  • #2 / Aug 11, 2011 4:54am

    John Henry Donovan

    12339 posts

    Brian,

    take a look at Dynamic Parameters. I think they will achieve exactly what you wish for.

    Let us know if that helps

  • #3 / Aug 11, 2011 11:25am

    Brian M.

    529 posts

    I was going to use Dynamic Parameters, but I didn’t think the title field would work correctly?  If someone fills in the ‘name’ field,  it needs to return all entries that contain the word or phrase in the title,  not all entries with titles equal to the word or phrase.  Does that work with dynamic parameters?

  • #4 / Aug 12, 2011 6:22pm

    Kevin Smith

    4784 posts

    I see what you’re asking, Brian. Dynamic Parameters wouldn’t be the solution for you here, and (I don’t believe) search allows wildcard searches. Have you taken a look at a third-party solution like Super Search?

  • #5 / Sep 08, 2011 2:13pm

    Brian M.

    529 posts

    Whoops I guess I replied to the email notification instead of this thread, and then I was away from work for a while.  Here’s what I tried to write a few weeks ago:

    I’ve been back and forth with the solspace guys for over two months about a super search pagination bug and I’m rewriting. I’m trying to go native the possible… Is the only native option to make the title field a search form and the other three fields a different form using dynamic parameters?

    Thanks!

  • #6 / Sep 09, 2011 4:57pm

    Kevin Smith

    4784 posts

    Hey Brian,

    I think using a combination of dynamic parameters with the Channel Entries Tag’s search parameter should allow you to accomplish what you want. Does that help?

  • #7 / Sep 09, 2011 5:29pm

    Brian M.

    529 posts

    That’s what you just said wouldn’t work 😉 The search parameter doesn’t do title.

  • #8 / Sep 12, 2011 3:39am

    John Henry Donovan

    12339 posts

    Brian,

    In theory this is possible. The following works but only for custom fields and not for titles. The dynamic parameters is basically a form so you have POST variables from submission. So if you include an input field you can pass this on submit to the the search parameter of your Channel Entries tags.

    This is my test code which works. Turn on PHP for your template and set it to parse on Input. Now I don’t think this is going to be your solution but will however let you explore the native way to it’s full potential. Your next step will be the Community Forums

    <form method="post" action="{path='about/dynamic'}">
    <label>FOO Field</label>
    <input name="foo_title" id="foo_title" />
    
    <select name="orderby">
    <option value="date">Sort By:</option>
    <option value="date">Date</option>
    <option value="title">Title</option>
    <option value="comment_total">Most Comments</option>
    </select>
    
    <select name="sort">
    <option value="asc">Order In:</option>
    <option value="asc">Ascending</option>
    <option value="desc">Descending</option>
    </select>
    
    <select name="limit">
    <option value="10">Result Limit:</option>
    <option value="10">10</option>
    <option value="20">20</option>
    <option value="30">30</option>
    </select>
    
    <input type="submit" value="Go!" />
    
    </form>
    <ul>
    {exp:channel:entries channel="about" dynamic_parameters="orderby|limit|sort" search:about_body="<?php echo $_POST['foo_title'];?>"}
    <li>{title}</li>
    {/exp:channel:entries}
    </ul>
  • #9 / Sep 12, 2011 8:58am

    Brian M.

    529 posts

    The title is really what I was interested in - the other stuff works easily with search parameters like you said…  I went back and forth with SolSpace about bugs in SuperSearch and was hoping for something more native.

    Thanks.

  • #10 / Sep 12, 2011 5:37pm

    Kevin Smith

    4784 posts

    That’s what you just said wouldn’t work 😉 The search parameter doesn’t do title.

    😝 Sorry, I must have been having an off moment!

    Unfortunately, it does look like there’s not a native way to accomplish what you’re looking to do.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases