Skip to:
Content
Pages
Categories
Search
Top
Bottom

Navigation problems :(

  • Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    Hi Folks,

    Just a wee one! My php isn’t that good so I need some help here :)

    look at http://gigbuddy.org/about/

    The top nav option for ‘about’ isn’t highlighted – and I would like it to be.

    Here’s the code i’ve used in header.php

    <li><a href="<?php echo $bp->root_domain; ?>/about/" title="<?php _e( 'About', 'buddypress' );?>"><?php _e( 'About', 'buddypress' );?></a></li>

    the root_domain thing needs to be in there I think to stop the links from buggering up.

    Any ideas how I can get the tab to highlight?

    Cheers,

    Phil

Viewing 16 replies - 1 through 16 (of 16 total)
  • Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    sorry – i set the question status wrong

    Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    Sorry to be posting again – I really need help with this issue. Is there anyone that can oblige?

    I’m sure it’s just something small that i’ve overlooked, if you can help i’d appreciate that greatly :)

    Avatar of Andy Peatling
    Andy Peatling
    Keymaster

    @apeatling

    Try this:

    <li<?php if ( is_page( \'about\' ) ) : ?> class=\"selected\"<?php endif; ?>><a href=\"<?php echo $bp->root_domain; ?>/about/\" title=\"<?php _e( \'About\', \'buddypress\' );?>\"><?php _e( \'About\', \'buddypress\' );?></a></li>

    Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    Hi Andy,

    I get this:

    Parse error: syntax error, unexpected ‘:‘ in /home/fhlinux140/g/gigbuddy.org/user/htdocs/wp-content/themes/gigbuddy-home/header.php on line 41

    Any other ideas?

    Phil

    Avatar of Sgrunt
    Sgrunt
    Participant

    @sgrunt

    i hope this could help: try change THIS

    <li<?php if ( is_page( ‘about’ ) : ?> class=”selected”<?php endif; ?>

    into THIS

    <li<?php if ( is_page( ‘about’ ) ) {?> class=”selected”<?php } ?>

    Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    Hi Sgrunt,

    This works except the home tab stays selected have a look, http://gigbuddy.org/about/

    I’d expect that’s wh andy put in the endif.

    I need the home tab de-selected.

    Phil

    Avatar of Sgrunt
    Sgrunt
    Participant

    @sgrunt

    yes, in the example there is written if ( is_page( ‘about’ ) and so when you are watching the about page it selects HOME also. I presume you can change it in:

    if ( is_page( ” )

    but i’m not sure

    Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    I’m totally flummoxed by this one! Y’see I don’t know enough php and how to use the syntax correctly to be able to fix this – Andy, if you’re there … please help ;)

    Avatar of Sgrunt
    Sgrunt
    Participant

    @sgrunt

    last try

    instead of if ( is_page( ‘about’ )

    try if ( is_page( ‘home’ )

    Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    nope, that just takes it off the ‘about’ tab completely :(

    Avatar of Andy Peatling
    Andy Peatling
    Keymaster

    @apeatling

    The latest trunk will stop the home page from highlighting, it’s actually a BP bug.

    Also – I missed a ) off my example which was causing the error.

    Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    Hi Andy, Thanks for that (damned brackets lol). I’ve been using a zip version of buddypress from about 2-3 weeks back. Everything ‘so far’ (touch wood) has worked and thought there was no need to update from the trunk. This was the first time EVERYTHING in a bp install worked for me. My problem is, that if I do update from the trunk then everything will go ‘boobies to the dasies’ if you know what I mean, as there have been significant changes e.g. where you’ve placed the member themes etc.

    If there is a hack I can implement to tide me over I would be extremely grateful. I’m almost finished the site y’see and will be demoing it tomorrow.

    Thanks for your time as always.

    Phil

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    I understand your reluctance to install a new version of bp on the day before a site demo. I see the issue you are talking about. Your ‘home’ tab highlight doesn’t turn off when you choose ‘about’. It does with the other tabs you have such as ‘blogs’ are selected. Whatever code you are using for those tabs in your theme should be used for ‘about’.

    Since this is a custom theme you’re running it’s tough to help out.

    Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    @ Burt,

    Thanks for your reply. The only thing that’s changed is that i’ve added the ‘about’ tab (and renamed some of the other existing tabs). I see that Andy has managed to do exactly what I need to do with the new BP site but I also assume that this relies on the new trunk. Would someone be able to add the ‘nav’ portion of the php code from header.php in the new trunk here so i can try to hack it? Alternatively is there a browser based php interrogator (like firebug) so that I may see what has been done to this site?

    @ Everyone,

    Cheers for all your help so far guys – I’d still be stuck with the ‘about’ tab not highlighting otherwise, I am truly grateful for your help ;)

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    http://pastie.org/427663

    You don’t have to install the latest trunk to get it and take a look at it Phil.

    From the linux cmd line:

    svn co http://svn.buddypress.org/trunk

    From windows using http://tortisesvn.net

    http://svn.buddypress.org/trunk

    I dunno Mac.

    You can just create a directory somplace and check out the files to that dir. Then you have a copy of the latest bp to play with.

    Avatar of Reprocessor
    reprocessor
    Participant

    @reprocessor

    Righteo, I spoke to a mate about this earlier and he said it was a function. I went raking to see if the function in the trunk was different from my current install – lo and behold, it was, so I\’ve just tested the replacement function and everything is hunky-dory :)

    For anyone in the same prediciment as me it\’s here – replace the old function with this:

    bp-core/bp-core-templatetags.php on line 392

    function bp_is_page($page) {
    global $bp;

    if ( $bp->displayed_user->id || $bp->is_single_item )
    return false;

    if ( $page == $bp->current_component || ( is_home() &amp;&amp; $page == \'home\' &amp;&amp; $bp->current_component == $bp->default_component ) || ( $page == MEMBERS_SLUG &amp;&amp; !$bp->current_component ) )
    return true;

    return false;
    }

    I am SOOOOOOOOO chuffed that’s out of the way :)

Viewing 16 replies - 1 through 16 (of 16 total)

You must be logged in to reply to this topic.