Support » Plugin: Events Manager - Calendar, Bookings, Tickets, and more! » Event Manager: Search not working when its formatted using event-list template

  • Resolved Harshal24

    (@harshal24)


    Hi Marcus let me start off by saying its a great plugin, well done you guys.

    I am new here so don’t know how things work around here, i hope this doesn’t become a repost of http://wordpress.org/support/topic/events-manager-search-does-not-work?replies=11#post-4476935

    But unfortunately I am having a problem; the search doesn’t work
    – if i type the name in the search box
    -if i choose the dates from the datepicker
    In both cases it shows all the events.
    Only the relevant category from dropdown menu works.(I am not using location in search)

    I have upgraded it to Version 5.4.4.2. Same issue when i change my theme to Twenty Twelve. I found out that the search stops working when i change the format in wp-content\themes\twentytwelve\plugins\events-manager\templates\events-list.php.
    But when i put the same format via the dashboard under events > settings > formatting tabs the search works fine.
    In my template file the only change i am making is instead of echo EM_Events::output( $args ); i am using

    echo EM_Events::output(array('scope'=>'future', 'limit'=>3,'format'=>'<li>
        <div class="date-box">
            <span class="month">#M</span>
            <span class="date">#j</span>
            <span class="day">#D</span>
        </div>
        #_EVENTIMAGE
        <div class="course-excerpt">
            <h1>#_EVENTNAME</h1>
            <span class="short">#F #j,#Y | #h#a GMT #P hrs</span>
            #_EVENTEXCERPT<a href="#_EVENTPAGEURL" class="more">More Details</a>
        <div class="footer"><a href="#" class="enroll">Enroll</a><span class="price">#_EVENTPRICERANGE
    </span><span>16 PDUs</span></div>
        </div>
    </li>'));

    Can you tell me what could be the problem? I need it in a template file cause i am planning to bring in values from custom fields later.

    I hope this is the right place to find help 🙂

    http://wordpress.org/plugins/events-manager/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    since this code is the default one – EM_Events::output( $args );

    how about if you try to append new values to it ($args is array) instead of declaring new array OR use array merge?

    Thread Starter Harshal24

    (@harshal24)

    Hey as i told you i am a bit new to wordpress & php. Sorry to trouble you but is it possible for you to give me an example?

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    let’s continue here 🙂

    first step would be to stop using templates to figure out if the issue is on your side of things or on ours. i.e. rename your theme/plugins/events-manager folder

    I think this is because you’re not using the $args in the events-list.php template to show results, which factors in what is submitted in searches.

    Thread Starter Harshal24

    (@harshal24)

    Thanks 🙂
    Well as i mentioned before it works fine when i stop using event-manager templates. Or when i format via the dashboard under events > settings > formatting tabs.
    But i am using templates coz i also need to display additional information like trainer name, duration of course & points.
    For trainer name I am not using #_CONTACTNAME coz all the events will be entered by a single user & creating multiple users doesn’t make sense.

    So other than creating custom placeholders for the additional information do you have any idea how to go about doing this using $args?

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    to get you started:

    $args['scope'] = 'future';
    //etc
    echo EM_Events::output($args);
    Thread Starter Harshal24

    (@harshal24)

    Thank you Marcus it sort of worked 😉
    I followed the above method & it didn’t work at first but then, by process of elimination, I figured out the problem, it was infact $args['scope'] = 'future'; if i removed that the search worked.
    So my code looks like this now:

    $args = apply_filters('em_content_events_args', $args);
    
    if( get_option('dbem_css_evlist') ) echo '<div class="css-events-list">';
    /*$args['scope'] = 'future';*/
    $args['limit'] = 3;
    $args['pagination'] = 1;
    
    $args['format'] = '<li>
        <div class="date-box">
    	 <time itemprop="startDate" datetime="#Y-#m-#d"></time>
            <span class="month">#M</span>
            <span class="date">#j</span>
            <span class="day">#D</span>
        </div>
        <div class="img-holder">#_EVENTIMAGE</div>
        <div class="course-excerpt">
            <h1 itemprop="summary">#_EVENTNAME</h1>
            <span class="short">#_EVENTDATES | #h#a GMT #P hrs | duration | '.$pdu.' PDUs</span><span itemprop="description">#_EVENTEXCERPT</span><a href="#_EVENTPAGEURL" class="more" itemprop="url">More Details</a>
        <div class="footer" itemprop="offerDetails" itemscope itemtype="http://data-vocabulary.org/Offer"><a href="#" class="enroll">Enroll</a><meta itemprop="currency" content="USD" /><span class="price" itemprop="price">#_EVENTPRICERANGE</span><span><span class="categry">Related course on</span> #_EVENTCATEGORIES</span></div>
        </div>
    </li>';
    echo '<ul class="event-list" itemscope itemtype="http://data-vocabulary.org/Event">';
    echo EM_Events::output( $args );
    echo '</ul>';
    
    if( get_option('dbem_css_evlist') ) echo "</div>";

    Ofcourse this is with google microdata format which helps in seo. 😉

    Thanks a lot Marcus 😀

    Now i am not sure if there needs to be another thread created for this or this is the right place since its still search related, but when i select “This event does not have a physical location”. The search says no events found for any of the categories, search field or even when i am not using templates.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    could it be because you have a default country set? If so, the default country is used in the events page search form. No-locations will never show

    Thread Starter Harshal24

    (@harshal24)

    Yup that was it!!

    Thanks a LOT!!
    😀

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Event Manager: Search not working when its formatted using event-list template’ is closed to new replies.