• Resolved Wouters

    (@wouters)


    Hi, I have a couple of custom attributes, like:

    #_ATT{Unit}{AMS|UTR|RTM|UIT|FST} and #_ATT{Factuur NR.}

    But if I just use a page called “Planning” and add CONTENTS in it, it display’s the events and the search option. But, if I try and search for example the number BLU150417 which is value from Factuur NR. it returns “No Events”. Is it possible to search for custom attributes?

    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter Wouters

    (@wouters)

    I added this piece of code I found on this forum, but that didn’t help…

    function timeperiod_search($searches, $array){
        if( !empty($array['Referentie NR.']) ){
            $searches['Referentie NR.'] = $array['Referentie NR.'];
        }
        return $searches;
    }
    add_filter('em_events_get_default_search','timeperiod_search',1,2);

    To use custom attributes with your search form you’d need to use coding like this:
    https://pastebin.com/AKcHqdm7

    Thread Starter Wouters

    (@wouters)

    @caimin_nwl, Thanks for the link. I did this but now it’s a drop down. Which isn’t exactly what I’m looking for. I would like to be able to search in the events using search strings like “BLU150417” or even just “BLU” and then it would show the events. Is that possible?

    That might be possible but you’d needed create your own code or modify the example above.

    I’m trying to do something similar but simply add tags and categories into the search results without an advanced field for the search. I’ve been trying everything under custom search attributes and nothing works but perhaps I’m not adding the snippets in the right places.

    Thread Starter Wouters

    (@wouters)

    @caimin_nwl: Is it possible you could document this? I think it would be a great feature?

    Sorry, the only way to do it would be using custom code or a modification of the previous example.

    Are event-tags attributes?

    No, but we do have the code sample to include them in event searches, if that’s what you were wondering:

    https://pastebin.com/2GiqjWfG

    Thanks, but I’m looking for the tags and categories as part of the search without extra filter fields. So right now if someone searches for “concerts” in X area they get no results unless the word “concerts” is in the event text.
    Can I pay for some support in getting this code written?

    Sorry, we don’t offer custom development work.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Search custom attributes’ is closed to new replies.