Forums Forums Search & Filter Pro Pass the search value between forms/results

Viewing 10 posts - 1 through 10 (of 20 total)
  • Trevor
    #266377

    It should normally be possible. Can you give me an example on your site?

    I would need:

    #1 The search term
    #2 The page URL that has the basic search form
    #3 The page URL that has the advanced form

    Anonymous
    #266379

    Also one difficulty one might encounter if using the same form is that on the basic search I only want to display the 5 more relevant result (all set nicely with relevanssi, nice integration by the way) while on the advanced search I want every result.

    An other advantage to have two diferrent form is that the first form may search in page and post, while the advanced search on other post-type for instance ๐Ÿ™‚

    cheers

    Trevor
    #266381

    I think our posts passed in the ether. Do you mean that you would sometimes want to stay on the origin page, and sometimes go to the advanced search page?

    Anonymous
    #266383

    Hi,

    haven’t seen your reply…

    two things,
    – I don’t know if I should only built one form or two (at the moment I only have one)
    – the site I’m working on is under construction, with no public access yet, I may create you an account if you really need

    but if you could explain me the porces to set this up it might be easier ๐Ÿ™‚

    Thank’s

    Anonymous
    #266385

    Haha again our post passed in the ether

    Sorry about that

    yes exactly, I want the user to be able to do a search and display the resut on the basic page, where he is also inviter to doan advanced search.

    But I wouldn’t be nice in term of user experience to simply send him to a different page, the idea is to get the search he did on the basic page, and use it on the advanced page when he land here ๐Ÿ™‚

    Trevor
    #266388

    The second option, where the search on the origin page always goes to the results page, is easy.

    Have two forms. For this example, I will assume some basic design:

    #1 On the origin page. Have just a Text search field. Display Results Method set to Custom, URL set to the Advanced Search Results Page, AJAX off.

    #2 On the Advanced Search Results Page. Has a Text Search field and other fields. This form set as you wish.

    The search text from the origin page and form 1 will pass to form 2.

    Anonymous
    #266396

    Hi again ๐Ÿ™‚

    Ok, that’s a cool way to pass the data, we are getting closed but not quite there yet.

    The idea is to display some “basic” result on the basic search page, in ajax, and add a link or button at then end of the results template (out of the loop) to go to the advance search. The user may or may not go to the advanced search, he do not have to, but may, and if so, instead of a simple link to the advanced search page, the data is passed to the advanced form/results (and if it is not the same form the result may be different) ๐Ÿ™‚

    let’s say

    Basic form
    only text search
    only 5 result, no pagination
    only post-type page

    Advanced form
    Several search field including text search
    unlimited result paginated
    any post-type

    the idea is to be able to do a basic search, and extend it to the advanced one, without having to resubmit the value entered on the basic search

    (this is important since the basic search will actually have 2 to 4 field, while the advanced one 5, and broaden categories and post-types)

    This is what I would really like to achieve?


    possible solution

    Can we get the form field value into the result template ?

    then we could generate a html link with php var values
    $formfield1 = get_S&F_field_1_Value
    $formfield2 = get_S&F_field_2_Value

    “&field2=<?php echo $formfield2 ?>” />

    or something like this ?

    Anonymous
    #266398

    sorry forgot to use the code tag

    <a href="http://mydomain.net/advanced-search.php?field1="<?php echo $formfield1 ?>"&field2=<?php echo $formfield2 ?>"> Extend your search <a/>

    Trevor
    #266406

    Try making three forms?

    The third form identical to form 2, but set to Custom no Ajax and pointing to the other page.

    Then, modify form 1 to be a normal form with results on that origin page.

    On the origin page, also have form 3. Don’t worry that it is visible for now, this is just a test.

    Then, when you do a search, do the fields in forms 1 and 2 set themselves the same?

    Anonymous
    #266411

    Hi

    before digging into this let me ask a question

    should I have

    Basic form
    Advanced 1
    Advanced 2

    Or
    Basic 1
    Basic 2
    Advnaced

    — I assumed one basic and two advances
    so I enter the data in the basic and advanced 1, and on submit of advanced 1 it goes to custom wich is actually advanced 2

    right

Viewing 10 posts - 1 through 10 (of 20 total)