WordPress.org

Forums

Events Manager
[resolved] search by tags (15 posts)

  1. czarnuch85
    Member
    Posted 1 year ago #

    hello is it a simple way to search events by tags? because in default event manager is searching only by title and description of the event :(

    i would be very grateful for any help :)

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

  2. angelo
    NetWebLogic Support
    Posted 1 year ago #

    hi,

    you can try to use shortcode [events_list tag="music,sports"]

    http://wp-events-plugin.com/documentation/event-search-attributes/

  3. czarnuch85
    Member
    Posted 1 year ago #

    it is not an option :( i should have posibility, when some user types for example "bike" into a search box to show him the list of all events with "bike" tag.

  4. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    If it helps, here's a code snippet that adds tags as a search option to the default search form:

    http://pastebin.com/V96b5RN9

  5. czarnuch85
    Member
    Posted 1 year ago #

    i found it before but i thinks it is prepared for old version of event menager. in events-list.php i've got only this:

    $args = apply_filters('em_content_events_args', $args);
    
    if( get_option('dbem_css_evlist') ) echo "<div class='css-events-list'>";
    
    echo EM_Events::output( $args );
    
    if( get_option('dbem_css_evlist') ) echo "</div>";
    
    not this: em_locate_template('templates/events-search.php',true);

    in events-search.php i don't have $selected = !empty($_REQUEST['search-tag']) ? $_REQUEST['search-tag'] : 0;

    either.

  6. angelo
    NetWebLogic Support
    Posted 1 year ago #

    yes it does however you can still use that snippet following the instruction on it.

  7. czarnuch85
    Member
    Posted 1 year ago #

    ok i did everything from instruction but exactly in which place of code should i copy snippets? could u send me the right files?

  8. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    Looks like the template layout has changed since that snippet was written.

    In your event-search.php template, put the new code under this bit:

    //categories
    if( !empty($args['search_categories']) ) em_locate_template('templates/search/categories.php',true,array('args'=>$args));

    In events-list.php, put the snippet above:

    $args = apply_filters('em_content_events_args', $args);

  9. czarnuch85
    Member
    Posted 1 year ago #

    unfortunetly still no luck :(

  10. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    Can you paste the code as you have it now?

  11. czarnuch85
    Member
    Posted 1 year ago #

    in events-search.php:

    <?php
    /* WARNING!!! (2013-07-10) We intend to add a few more fields into this search form over the coming weeks/months.
     * Overriding shouldn't hinder functionality at all but these new search options won't appear on your form!
     */
    /*
     * By modifying this in your theme folder within plugins/events-manager/templates/events-search.php, you can change the way the search form will look.
     * To ensure compatability, it is recommended you maintain class, id and form name attributes, unless you now what you're doing.
     * You also have an $args array available to you with search options passed on by your EM settings or shortcode
     */
    $args = !empty($args) ? $args:array(); /* @var $args array */
    ?>
    <div class="em-search-wrapper">
    <div class="em-events-search em-search <?php if( !empty($args['main_classes']) ) echo esc_attr(implode(' ', $args['main_classes'])); ?>">
    	<form action="<?php echo !empty($args['search_url']) ? esc_url($args['search_url']) : EM_URI; ?>" method="post" class="em-events-search-form em-search-form">
    		<input type="hidden" name="action" value="<?php echo esc_attr($args['search_action']); ?>" />
    		<?php if( $args['show_main'] ): //show the 'main' search form ?>
    		<div class="em-search-main">
    			<?php do_action('em_template_events_search_form_header'); //hook in here to add extra fields, text etc. ?>
    			<?php
    			//search text
    			if( !empty($args['search_term']) ) em_locate_template('templates/search/search.php',true,array('args'=>$args));
    			if( !empty($args['search_geo']) ) em_locate_template('templates/search/geo.php',true,array('args'=>$args));
    			?>
    			<?php if( !empty($args['css']) ) : //show the button here if we're using the default styling, if you still want to use this and use custom CSS, then you have to override our rules ?>
    			<button type="submit" class="em-search-submit loading">
    				<?php //before you ask, this hack is necessary thanks to stupid IE7 ?>
    				<!--[if IE 7]><span><![endif]-->
    				<img src="<?php echo EM_DIR_URI; ?>includes/images/search-mag.png" />
    				<!--[if IE 7]></span><![endif]-->
    			</button>
    			<?php endif; ?>
    		</div>
    		<?php endif; ?>
    		<?php if( !empty($args['show_advanced']) ): //show advanced fields, collapesed if the main form is shown, inline if not ?>
    		<div class="em-search-advanced" <?php if( !empty($args['advanced_hidden']) ) echo 'style="display:none"'; ?>>
    			<?php
    			//date range (scope)
    			if( !empty($args['search_scope']) ) em_locate_template('templates/search/scope.php',true,array('args'=>$args));
    			//categories
    			if( !empty($args['search_categories']) ) em_locate_template('templates/search/categories.php',true,array('args'=>$args));
    
    			$selected = !empty($_REQUEST['search-tag']) ? $_REQUEST['search-tag'] : 0;
    			wp_dropdown_categories(array( 'hide_empty' => 0, 'name' => 'search-tag', 'hierarchical' => true, 'taxonomy' => EM_TAXONOMY_TAG, 'selected' => $selected, 'show_option_none' => 'All Tags', 'class'=>'em-events-search-tag', 'orderby' =>'name'));      
    
    			//Location data
    			em_locate_template('templates/search/location.php',true, array('args'=>$args));
    			if( !empty($args['search_geo_units']) ) em_locate_template('templates/search/geo-units.php',true, array('args'=>$args));
    			?>
    			<?php do_action('em_template_events_search_form_footer'); //hook in here to add extra fields, text etc. ?>
    			<?php if( !$args['show_main'] || empty($args['css']) ): //show button if it wasn't shown further up ?>
    			<input type="submit" value="<?php echo esc_attr($args['search_button']); ?>" class="em-search-submit" />
    			<?php endif; ?>
    		</div>
    		<?php endif; ?>
    		<?php if( !empty($args['advanced_hidden']) && !empty($args['show_advanced']) ): //show the advanced search toggle if advanced fields are collapsed ?>
    		<div class="em-search-options">
    			<a href="#" class="em-toggle" rel=".em-search-advanced:.em-search-form">
    				<span class="hide" style="display:none;"><?php echo esc_html($args['search_text_hide']); ?></span>
    				<span class="show"><?php echo esc_html($args['search_text_show']); ?></span>
    			</a>
    		</div>
    		<?php endif; ?>
    		<?php if( (empty($args['show_advanced']) || empty($args['search_countries'])) && !empty($args['country']) ): //show country in hidden field for geo searching ?>
    		<input type="hidden" name="country" value="<?php echo esc_attr($args['country']) ?>" />
    		<?php endif; ?>
    	</form>
    </div>
    <?php if( !empty($args['ajax']) ): ?><div class='em-search-ajax'></div><?php endif; ?>
    </div>

    in events-list.php

    if ( $_REQUEST['search-tag'] != '-1' ){
                    $args['tag'] = $_REQUEST['search-tag'];
            }
    $args = apply_filters('em_content_events_args', $args);
    
    if( get_option('dbem_css_evlist') ) echo "<div class='css-events-list'>";
    
    echo EM_Events::output( $args );
    
    if( get_option('dbem_css_evlist') ) echo "</div>";
  12. adatfalo
    Member
    Posted 1 year ago #

    I have the same problem. :S

  13. angelo
    NetWebLogic Support
    Posted 1 year ago #

    czarnuch85, you might need a developer assistance to do this since am afraid that we can't help you with the full working code but we point you and answer your questions.

  14. czarnuch85
    Member
    Posted 1 year ago #

    mayby do you know someone who can help me with this? of course i will pay. this is very important to me and i still can't figure it out :(

    do you know if i pay for pro version of events manager do i get help in this case?

  15. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    Sorry, it would be the same situation even with the Pro version.

    This is a good place for finding developers:
    http://jobs.wordpress.net/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic