[buddypress-trac] [BuddyPress] #1244: ul#nav class="selected" and ul#bp-nav class="current" are mixing up

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Wed Oct 28 02:19:03 UTC 2009


#1244: ul#nav class="selected" and ul#bp-nav class="current" are mixing up
------------------------------+---------------------------------------------
Reporter:  21cdb              |       Owner:     
    Type:  defect             |      Status:  new
Priority:  major              |   Milestone:  1.2
Keywords:  reporter-feedback  |  
------------------------------+---------------------------------------------
Changes (by 21cdb):

 * cc: email@… (removed)


Comment:

 I did another test with the newest version of trunk. Please take this code
 and save it as header.php into ur bp-default theme folder. Check the items
 of bp-nav and u can see that ul#nav items are highlighted with
 class="selected" as well as bp-nav items with class="current".


 {{{
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes();
 ?>>

         <head profile="http://gmpg.org/xfn/11">

                 <meta http-equiv="Content-Type" content="<?php
 bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

                 <title><?php bp_page_title() ?></title>

                 <?php do_action( 'bp_head' ) ?>

                 <meta name="generator" content="WordPress <?php
 bloginfo('version'); ?>" /> <!-- leave this for stats -->

                 <link rel="stylesheet" href="<?php
 bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

                 <?php if ( function_exists(
 'bp_sitewide_activity_feed_link' ) ) : ?>
                         <link rel="alternate" type="application/rss+xml"
 title="<?php bloginfo('name'); ?> <?php _e('Site Wide Activity RSS Feed',
 'buddypress' ) ?>" href="<?php bp_sitewide_activity_feed_link() ?>" />
                 <?php endif; ?>

                 <link rel="alternate" type="application/rss+xml"
 title="<?php bloginfo('name'); ?> <?php _e( 'Blog Posts RSS Feed',
 'buddypress' ) ?>" href="<?php bloginfo('rss2_url'); ?>" />
                 <link rel="alternate" type="application/atom+xml"
 title="<?php bloginfo('name'); ?> <?php _e( 'Blog Posts Atom Feed',
 'buddypress' ) ?>" href="<?php bloginfo('atom_url'); ?>" />

                 <link rel="pingback" href="<?php bloginfo('pingback_url');
 ?>" />

                 <?php wp_head(); ?>

         </head>

         <body <?php body_class() ?>>

                 <?php do_action( 'bp_before_search_login_bar' ) ?>

                 <div id="search-login-bar">

                         <form action="<?php echo bp_search_form_action()
 ?>" method="post" id="search-form">
                                 <input type="text" id="search-terms" name
 ="search-terms" value="" />
                                 <?php echo bp_search_form_type_select() ?>

                                 <input type="submit" name="search-submit"
 id="search-submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
                                 <?php wp_nonce_field( 'bp_search_form' )
 ?>
                         </form>

                         <?php if ( is_user_logged_in() ) : ?>
                                 <ul id="bp-nav">
                                         <?php bp_get_nav() /* Load the
 user navigation */ ?>
                                 </ul>


                         <?php endif; ?>

                         <?php do_action( 'bp_search_login_bar' ) ?>

                 </div>

                 <?php do_action( 'bp_after_search_login_bar' ) ?>
                 <?php do_action( 'bp_before_header' ) ?>

                 <div id="header">

                         <h1 id="logo"><a href="<?php echo
 get_option('home') ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php
 bp_site_name() ?></a></h1>

                         <ul id="nav">
                                 <li<?php if ( bp_is_page( 'home' ) ) : ?>
 class="selected"<?php endif; ?>><a href="<?php echo get_option('home') ?>"
 title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress'
 ) ?></a></li>
                                 <li<?php if ( bp_is_page(
 BP_HOME_BLOG_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="<?php
 echo get_option('home') ?>/<?php echo BP_HOME_BLOG_SLUG ?>" title="<?php
 _e( 'Blog', 'buddypress' ) ?>"><?php _e( 'Blog', 'buddypress' )
 ?></a></li>
                                 <li<?php if ( bp_is_page( BP_MEMBERS_SLUG
 ) ) : ?> class="selected"<?php endif; ?>><a href="<?php echo
 get_option('home') ?>/<?php echo BP_MEMBERS_SLUG ?>" title="<?php _e(
 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' )
 ?></a></li>

                                 <?php if ( function_exists(
 'groups_install' ) ) : ?>
                                         <li<?php if ( bp_is_page(
 BP_GROUPS_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="<?php
 echo get_option('home') ?>/<?php echo BP_GROUPS_SLUG ?>" title="<?php _e(
 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' )
 ?></a></li>
                                 <?php endif; ?>

                                 <?php if ( function_exists(
 'groups_install' ) && ( function_exists( 'bp_forums_setup' ) && !(int)
 get_site_option( 'bp-disable-forum-directory' ) ) ) : ?>
                                         <li<?php if ( bp_is_page(
 BP_FORUMS_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="<?php
 echo get_option('home') ?>/<?php echo BP_FORUMS_SLUG ?>" title="<?php _e(
 'Forums', 'buddypress' ) ?>"><?php _e( 'Forums', 'buddypress' )
 ?></a></li>
                                 <?php endif; ?>

                                 <?php if ( function_exists(
 'bp_blogs_install' ) ) : ?>
                                         <li<?php if ( bp_is_page(
 BP_BLOGS_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="<?php echo
 get_option('home') ?>/<?php echo BP_BLOGS_SLUG ?>" title="<?php _e(
 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a></li>
                                 <?php endif; ?>

                                 <?php do_action( 'bp_nav_items' ); ?>
                         </ul>

                         <?php do_action( 'bp_header' ) ?>

                 </div>

                 <?php do_action( 'bp_after_header' ) ?>
                 <?php do_action( 'bp_before_container' ) ?>

                 <div id="container">

                         <?php if ( !bp_is_blog_page() &&
 !bp_is_directory() && !bp_is_register_page() && !bp_is_activation_page() )
 : ?>

                                 <?php locate_template( array(
 'userbar.php' ), true ) /* Load the user navigation */ ?>
                                 <?php locate_template( array(
 'optionsbar.php' ), true ) /* Load the currently displayed object
 navigation */ ?>

                         <?php endif; ?>

 }}}

-- 
Ticket URL: <http://trac.buddypress.org/ticket/1244#comment:4>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list