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, 9 months ago.
- 
		AuthorPosts
- 
		
			
				
January 6, 2016 at 9:41 am #20587hi, 
 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 January 13, 2016 at 10:40 pm #20697Hi 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 January 14, 2016 at 9:13 am #20712hi 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 January 14, 2016 at 9:08 pm #20734Regarding 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=monthlyOther 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-afor ‘Tag A’ events/event/?event-tag=tag-a,tag-bfor ‘Tag A’ or ‘Tag B’. And events/event/?event-tag=tag-a+tag-bfor 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-aIf 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 January 16, 2016 at 8:47 am #20786thanks! 
 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 January 16, 2016 at 12:27 pm #20789In the templates: archive-event.phpandtaxonomy-event-*.phpyou’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 January 16, 2016 at 7:27 pm #20800thank you! Rachel Druskin 
- 
		AuthorPosts