Support

Home Forums Event Espresso Premium How to customize Archive page with filter based

How to customize Archive page with filter based

Posted: July 29, 2019 at 8:30 am


Dairywomensnetwork

July 29, 2019 at 8:30 am

I have need help to fix list pages layout like with filter, Please review below screens:
https://www.screencast.com/t/3bl5jXpDFhN

Filter : Categories, Locations, Date
OR
Tags


Tony

  • Support Staff

July 30, 2019 at 8:59 am

Hi there,

If you are using our models to pull the events into that custom listing you basically just need to feed the selection into the models.

We don’t provide support for custom coding, but can help point you in the right direction.

The documentation for the model system can be found here:

https://github.com/eventespresso/event-espresso-core/tree/master/docs/G–Model-System

You need to set up the where conditions and pass them to the models, take a look at the examples here:

https://github.com/eventespresso/event-espresso-core/blob/master/docs/G–Model-System/model-query-params.md#0-where-conditions


Dairywomensnetwork

August 13, 2019 at 3:49 am

if (!empty($search)) {
$where[‘EVT_name’] = array(‘LIKE’, $search);
}

“DWN2020 Conference” : not working when search with half word.


Dairywomensnetwork

August 13, 2019 at 3:57 am

Solved :
$where[‘EVT_name’] = array(‘LIKE’, ‘%’.$search.’%’);


Tony

  • Support Staff

August 13, 2019 at 4:14 am

Just noting that the above is correct.

If you want results based on partial-string matches you need to pass the wildcard characters in the locations you want to use them (usually the beginning and end of the search string) as you have done above.


Dairywomensnetwork

August 20, 2019 at 4:25 am

Can you help me for state-based event list filter?

$where['Venue_Meta.STA_ID'] = 81;

I have tried above this code but not working. I have check document also but there has not this logic.

https://github.com/eventespresso/event-espresso-core/blob/master/docs/G–Model-System/model-query-params.md#0-where-conditions


Dairywomensnetwork

August 20, 2019 at 5:07 am

espresso_venue_id($event_id)
not wroking on event listing page. Can you help me get vanue id using event id on listing?


Josh

  • Support Staff

August 20, 2019 at 7:26 am

That should actually be something like:

EEM_Event::instance()->get_all(
    array(
        array('Venue.STA_ID'=>81)
    )
);

espresso_venue_id($event_id)
not wroking on event listing page.

Are you sure you have $event_id set?


Dairywomensnetwork

August 20, 2019 at 8:42 am

Are you sure you have $event_id set?

Yes, I have set but this function not working on an event for a loop.

I have customized but can you help me with this function.
espresso_venue_id($event_id)

my custom code after this not working form ref of admin side code. I suggest you please create well document with all king of conditions argument with filter opitons,

foreach ($events as $event):
            $evt_venues = $event->venues();
            $evt_venue = $evt_venues && is_array($evt_venues) ? reset($evt_venues) : null;
            $VNU_ID = $evt_venue instanceof EE_Venue ? $evt_venue->ID() : null;
            if(!empty($VNU_ID)):
                $venue = EEH_Venue_View::get_venue($VNU_ID);
                if(isset($venue) && !empty($venue)):
                    $state = $venue->state_obj();
                    if(is_object($state)):
                        $state_list[$state->get('STA_ID')] = $state->get('STA_name');
                    endif;
                endif;
            endif;
        endforeach;


Josh

  • Support Staff

August 20, 2019 at 8:52 am

It sounds like the trouble you’re having is because you’re trying to use functions that are only available on the frontend. Those will not work on the admin side.

You can use the model classes helper method directly, like this one, instead of “View”-based helper methods intended for the front end only. e.g.
$venue = EEM_Venue::instance()->get_one_by_ID($VNU_ID);

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: publish

Updated by  Josh 12 hours, 35 minutes ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!