Skip to:
Content
Pages
Categories
Search
Top
Bottom

Why does the activity menu have a relationship with selected menu item?


  • Shmoo
    Participant

    @macpresss

    Just curious..

    Why the red part gets checked before the filter select menu can work ?

    I’ve changed my menu a bit but for some reason the filter doesn’t work anymore and I’ve got the feeling I’m very close to the problem.

    My new menu:

    
    <nav class="item-list-tabs no-ajax nav-centered">
    	<ul class="button-group activity-type-tabs">
    		<li><a class="button" href="<?php bp_groups_directory_permalink(); ?>"><i class="fi fi-root-groups"></i></a></li>
    		<li class="selected"><a class="button" href="<?php bp_group_permalink(); ?>"><i class="fi fi-root-groups"></i></a></li>
    		<li><a class="button" href="<?php bp_group_permalink(); ?>members/">Abonnees</a></li>
    		<li class="group-btn-select item-list-tabs no-ajax">
    			<ul>
    				<?php do_action( 'bp_group_activity_syndication_options' ); ?>
    				<li id="activity-filter-select" class="last">
    					<select id="activity-filter-by" class="button filter">
    						<option value="-1">Alles</option>
    						<option value="activity_update">Updates</option>
    						<option value="joined_group">Abonnees</option>
    						<?php do_action( 'bp_group_activity_filter_options' ); ?>
    					</select>
    				</li>
    			</ul>
    		</li>
    		<?php if ( is_user_logged_in() && bp_group_is_member() ) : ?>
    		<li><a class="button" href="<?php bp_group_permalink(); ?>send-invites/"><i class="fi fi-megaphone"></i></a></li>
    		<?php endif; ?>
    		<?php do_action( 'bp_group_options_nav' ); ?>
    		<?php if ( is_user_logged_in() && bp_current_user_can( 'bp_moderate' ) ) : ?>
    		<li><a class="button" href="<?php bp_group_permalink(); ?>admin/edit-details/"><i class="fi fi-wrench"></i></a></li>
    		<?php endif; ?>
    		<li><a class="button" href="<?php bp_group_activity_feed_link(); ?>" title="RSS feed"><i class="fi fi-rss"></i></a></li>
    	</ul>
    </nav>
    

    Ajax-/JS code: ( changed div.activity-type-tabs to ul.activity-type-tabs )

    
    	/* Activity filter select */
    	jq('#activity-filter-select select').change( function() {
    		var selected_tab = jq( 'ul.activity-type-tabs li.selected' );
    
    		if ( !selected_tab.length )
    			var scope = null;
    		else
    			var scope = selected_tab.attr('id').substr( 9, selected_tab.attr('id').length );
    
    		var filter = jq(this).val();
    
    		bp_activity_request(scope, filter);
    
    		return false;
    	});
    
    

    I left all needed BuddyPress classes in play and for some reason it won’t filter. Only at Activity streams. Groups & Members index pages all filter nicely with almost the same menu.

    Image to give an example of what the menu looks like:

    Image of the error I get.

    Can somebody help me out here?
    It’s probably a little change in a line of code.

  • The topic ‘Why does the activity menu have a relationship with selected menu item?’ is closed to new replies.
Skip to toolbar