Show Custom Field only if in Search Filter

This topic contains 6 replies, has 3 voices, and was last updated by  Stiofan O’Connor 6 years, 7 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #423421

    jahusdtc
    Expired Member
    Post count: 162

    Can you tell me where to “grab” the search filter?

    I have custom field in Place. It is also included in the Search. All works wonderfully well.

    Now (of course!) I’m trying to do a little more.

    1. Is there a way to look at Search filter and determine if the Custom Field is used?

    2. And, while I’m asking…can I also look at Search Filter and determine if ONLY a category is chosen and not a “Search for” choice? I could look at the URL and parse it out, but figure the Search Filter would already take that into consideration…as well as LOTS of other things.

    Can you point me in the right direction, please?

    #423534

    Alex Rollin
    Moderator
    Post count: 27815

    1. I will flag your question for the developers.
    2. same

    #423646

    jahusdtc
    Expired Member
    Post count: 162

    Appreciate that, Alex!

    #423841

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello,

    1. i’m not really sure what you are asking exactly (could be a number of things) can you explain more?

    2. We take the info from the url also and validate it and then inject it into the query.

    Stiofan

    #424028

    jahusdtc
    Expired Member
    Post count: 162

    1. I have created a custom field geodir_affiliation that says Baptist or whatever. I have included it in the search by your very clever method (no pain, lots of gain!).

    On Advanced Search, let’s say I search for Baptist.

    My URL looks like this:
    https://thechristianbusinessdirectory.online/?geodir_search=1&stype=gd_place&sgd_placecategory%5B%5D=&s=+&snear=&sgeodir_affiliation=Baptist&sgeo_lat=&sgeo_lon=

    I ONLY want to show the church field on the Search page if they do this Advanced Search on geodir_affiliation. In general, not of interest to searchers…they didn’t CHOOSE to search based on that criteria. (Using this scenario as example, but COULD be any custom field in the Advanced Search.)

    I can parse out the URL in order to do this, but thought you might have someplace in your code where you already did the parsing. Could you let me know where I want to check this out?

    2. Similar question here…I want to find out if someone chose ONLY the Category, say, Accountants and put BLANK in the “Search For” search field. In that case, I’d like to conditionally insert the GD > CPT Categories widget (or shortcode, really) at the top of the page so they can see any SubCategories that are involved.

    Mainly interested if they pick Churches and put NO PARTICULAR Church in the “Search For” searcher field.

    Then, I want to have Categories and SubCategories at top of Search Page results.

    But first…I need to know if they did or did NOT pick Categories — without a “Search For” term.

    Again, figured you folks had already done something similar to this…and wanted to use your already-vetted function for my nefarious purposes.

    You have put an INCREDIBLE amount of thought — and insight — into your GeoDirectory plugin. Kudos!

    #424076

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #424152

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    1. i don’t see a church field but i assume you will have it in the listings, if so u could add a filter to do this, it would depend on the field html_var name and type.

    2. Do you mean the category and not a custom field for #1?
    Thats an intresting idea, we have not done this but its something i would like to make work by default in GDv2.

    Stiofan

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount