Search blog dropdown

This topic contains 5 replies, has 3 voices, and was last updated by  BL Interactive 9 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #31381

    BL Interactive
    Expired Member
    Post count: 83

    I have the search field at the top of every page, now the dropdowns are places and events. Is it possible to add a 3rd option that is everything and that pushed the search request to the default search so my visitors can search articles from the same form?

    places > places search results
    events > events search results
    everything > standard search results

    I am using advanced search if that helps/hurts things.

    #31391

    Guust
    Moderator
    Post count: 29970

    That would be very tricky if possible at all.
    Why not add GD Search widget and normal WP Search widget and title them:
    “Search listings” or “Search whole site”.

    #31404

    BL Interactive
    Expired Member
    Post count: 83

    Having multiple search boxes is bad UX.

    it just need to pass the field to URL?s=searchterm

    I love when someone says just need to when they have no idea.

    #31489

    Guust
    Moderator
    Post count: 29970

    Misread your question, I thought you want to search everything at the same time, which you can do with WP search, but it will not return the results of GD listings in the GD search page.
    I guess it might be possible to add an extra option by copying the widget and adding your own code.
    I’ll alert the others to your question too.

    #31555

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    I’ve looked into your request and stopped after 5 minutes because it would require to rewrite part of the GD search widget and also modify part of the advance search widget addon. Not even sure it can all be done only via hooks. Only Stiofan could tell us more about it…

    I think there is a much simpler option that you should consider and that integrates Guust’s suggestion.

    Instead of using 2 forms on the page that I agree would be bad UX, you could show only the form needed and add the selection Listings/Everywhere elsewhere.

    Example: http://wpgeo.directory/

    added a text widget above the gd search widget.
    added 2 links “Listings” “Everywhere”.
    added the regular search below the gd search widget and hidden with css.
    added few lines of JS to show/hide one or the other
    added little css for regular form to start look like listings form and give you the idea.

    html for links in text widget:

    
    
    <div class="alternative-search"><a id="gd-listings" href="#">Listings</a>
    <a id="everything" href="#">Everything</a></div>

    css:

    
    
    .widget_search .screen-reader-text {
        display: none;
    }
    #s {
        float: left;
        margin: 0 10px 0 0;
        background-color: #fff;
    }
    .widget .searchform {
        margin: 10px auto;
        width: 33%;
    }
    .widget_search {
        display: none;
    }

    jQuery:

    
    
    <script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery("#gd-listings").click(function(){
            jQuery(".widget_search").hide();
            jQuery(".geodir_advance_search_widget").show();
    return false;
        });
        jQuery("#everything").click(function(){
    jQuery(".widget_search").show();
            jQuery(".geodir_advance_search_widget").hide();
    return false;
        });
    });
    </script>

    If you like the idea, this can be accomplished with another 15 minutes of css and it took me 10 minutes from start to end.

    Achieving the same modifying the code would take so much longer that I wouldn’t even consider it.

    Let us know,

    Thx

    #31560

    BL Interactive
    Expired Member
    Post count: 83

    Thanks for looking into this.

    Funny I was dabbling with something similar. Trick is, I am using the search shortcode to integrate with some of my non GD pages.

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket