Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding subnav-items: bp_core_add_subnav_item()

  • Avatar of Tore
    Tore
    Participant

    @toregus

    Hi there!

    I’ve been advancing in my skills in modifying the theme (from nothing). Now I’m at the point where I want to add additional items to the optionsbar. I’m going to add a page in the Events plugin’s optionsbar (but this is not a third party support question). I’m about to do this with the groups’ optionsbar also. So this is a general question.

    I’ve located that I need to add this:

    bp_core_add_subnav_item( $bp->events->slug, 'all-events', __('All Events', 'bp-events'), $events_link, 'events_screen_all_events', false, bp_is_home() );

    What I don’t understand is how I go about pointing to all-events.php which is a file I’ve created in the right directory. I understand that it has something to do with $events_link. But where do I add how the adress to the file?

    I’d like to do it in bp-custom.php if possible.

    Any help would be greatly appreciated! I’ve read the Codex but it’s a little bit above me

    (am using the latest WPMU, BP and Events 0.60 trunk)

    Tore G

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of Tore
    Tore
    Participant

    @toregus

    Just a friendly bump. I haven’t managed to find this out by myself.

    Avatar of Mariusooms
    Mariusooms
    Participant

    @mariusooms

    Put this line :

    $events_link = $bp->root_domain . '/' . $bp->events->slug . '/';

    above your code:

    bp_core_add_subnav_item( $bp->events->slug, 'all-events', __('All Events', 'bp-events'), $events_link, 'events_screen_all_events', false, bp_is_home() );

    You will need the adjust the path for that variable as I don’t know exactly where your all-events.php is needed.

    P.s. “bp_core_add_subnav_item” will be depreciated in BP1.1, but it has a better similar alternative that allows item positioning.

    Avatar of Mariusooms
    Mariusooms
    Participant

    @mariusooms

    For example, depending on your needs it could look like:

    $events_link = $bp->loggedin_user->domain . $bp->events->slug . '/';

    Which would be specefic to the logged in user.

    Avatar of Tore
    Tore
    Participant

    @toregus

    Fantastic! I hadn’t seen your post. I’m used to have email updates from forums (I’ve seen that on the roadmap).

    Thanks for the info on 1.1 also! I’ve checked the IRC for daily updates and it seems there’s lots of changes coming.

    Now I can get back on track. :)

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

The topic ‘Adding subnav-items: bp_core_add_subnav_item()’ is closed to new replies.