use event search template as event list

WordPress Event Management, Calendars & Registration Forums General Question use event search template as event list

This topic contains 6 replies, has 2 voices, and was last updated by  Rachel Druskin 9 years, 2 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #20587

    hi,
    is there a way to display events list as event search? i’m asking because i have several
    event categories that i would like to filter and display combining with event tags.
    take for example i have the following categories: movies, concert, shows
    and the following tags: kids, adults, families etc.
    i would like to display list of movies that are suitable for kids, but not as event list (that generate a bullet
    list of events), more like event search shown in here)
    keep in mind that, i would still like to keep the option to display events list.
    another question: is there a way to display search events, and send automatically the arguments i
    want and hide the search filters?
    thanks!

    Rachel Druskin
    #20697

    Hi Rachel,

    I think a better way of doing this would be to create a widget which allows you to select a category and/or tag, and on dong so redirects the user to:

    yoursite.com?event-category=<selected-category-slug>&event-tag=<selected-tag-slug>
    

    That URL will show all events in the selected category and tag, and display them as a page of events (rather than a simple list). The template for that page can be edited by editing the following:

    • archive-event.php
    • taxonomy-event-category.php
    • taxonomy-event-tag.php

    another question: is there a way to display search events, and send automatically the arguments i want and hide the search filters?

    Do you mean you want to hide some of the filters? If so, that is possible: (see filters attribute) http://docs.wp-event-organiser.com/shortcodes/event-search/

    Stephen Harris
    #20712

    hi Stephen,
    what do you mean by “create a widget”? for multiple tags, i just add “,” between them?

    about the second question, i meant that a certain page will display search results without
    showing the search filter (with predefined search params).

    thanks!

    Rachel Druskin
    #20734

    Regarding the second question, generally if you take your events page url:

    www.yoursite.com/events/event/
    

    and append any query variables, then it should work:

    www.yoursite.com/events/event/?s=monthly
    

    Other parameters include event_start_after`` andevent_end_after` (or _before). For event tags/venues/categories you can do (for example)

    events/event/?event-tag=tag-a
    

    for ‘Tag A’

    events/event/?event-tag=tag-a,tag-b
    

    for ‘Tag A’ or ‘Tag B’. And

    events/event/?event-tag=tag-a+tag-b
    

    for events with both Tag A and Tag B.

    Please note: the page titles probably will be misleading. For instance in the case of the above it might read, ‘Event tag: Tag A’. The logic in the templates hasn’t been configured to handle queries where multiple tags, or even taxonomies are being queried, but you can edit those templates to handle that situation.

    For first part, I simply meant [registering a new widget]https://codex.wordpress.org/Widgets_API) which would list any filters you want to implement (i.e. tags, categories etc). You’ll need to keep track of the user’s current selection (e.g. by inspecting the URL or session cookies). So, for instance if the user has selected a tag they might be on:

     www.yoursite.com/events/event/?event-tag=tag-a
    

    If they then select a tag B and you want to show events in both tag A and tag B then you would link them to:

     www.yoursite.com/events/event/?event-tag=tag-a+tag-b
    

    (or use a comma for events with either Tag A or Tag B).

    Stephen Harris
    #20786

    thanks!
    regarding this:
    the page titles probably will be misleading. For instance in the case of the above it might read, ‘Event tag: Tag A’. The logic in the templates hasn’t been configured to handle queries where multiple tags, or even taxonomies are being queried, but you can edit those templates to handle that situation.
    how can i edit the page title according to url query?

    Rachel Druskin
    #20789

    In the templates: archive-event.php and taxonomy-event-*.php you’ll have something like (for instance, the event tag template):

    <h1 class="page-title">
        <?php printf( __( 'Event Tag: %s', 'eventorganiser' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?>
    </h1>
    

    You can edit that to display whatever text you like depending on what has been queries.

    You can use get_query_var('event-tag') to get the value for event tags. It’ll be a string and could be anything like:

    • 'tag-a' (events in tag a)
    • 'tag-a+tag-b' (events in tag a and tag b)
    • 'tag-a,tag-b' (events in tag a or tag b)

    You can also check the other taxonomies (in case they querying events in venue x and tag a). So as you can see you can cater for any number of scenarios.

    I’m not entirely sure on which template WordPress will pick when there are multiple taxonomies queried – so you may want to add the same logic to all templates.

    Stephen Harris
    #20800

    thank you!

    Rachel Druskin
Viewing 7 posts - 1 through 7 (of 7 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.