[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 01:57:10 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@… (added)


Comment:

 Hey John James Jacoby, i missed ur reply.

 I changed my navigation so that it doesn't match the screenshots exactly,
 but the error is still there. Please find my header.php code attached in
 which the "Home" Button AND the Profile Button gets a highlight when on
 Home Page.


 {{{
 <!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" />
                 <link rel="shortcut icon" href="<?php
 bloginfo('stylesheet_directory')?>/favicon.ico" type="image/x-icon">
                 <link rel="icon" href="<?php
 bloginfo('stylesheet_directory')?>/favicon.ico" type="image/x-icon">

                 <?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 load_theme_textdomain('envicom','wp-content/themes
 /bp-themes/bp-envicom/languages/');?>
                 <?php wp_head(); ?>

         </head>

         <body <?php body_class() ?>>

                 <div id="wrapper-outline">

                 <?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>


                 <?php if ( is_user_logged_in() ) : ?>

                                         <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>
                                                 <?php bp_get_nav() ?>
                                         </ul>

                                         <div id="logout-link">
                                         <?php bp_loggedin_user_avatar(
 'width=19&height=19' ) ?><?php bp_log_out_link() ?>

                                         <?php do_action(
 'bp_login_bar_logged_in' ) ?>
                                         </div>

                 <?php else : ?>

                                         <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_FEATURES_SLUG
 ) ) : ?> class="selected"<?php endif; ?>><a href="<?php echo
 get_option('home') ?>/<?php echo BP_FEATURES_SLUG ?>" title="<?php _e(
 'Features', 'envicom' ) ?>"><?php _e( 'Features', 'envicom' ) ?></a></li>




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

         <?php endif ?>


                         <?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()
 && !bp_is_features_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:3>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list