Skip to:
Content
Pages
Categories
Search
Top
Bottom

Customizing profile page navigation strip


  • nigelanderson
    Member

    @nigelanderson

    Hi

    When you look at a user’s profile, there is a navigation strip (a div with id=”item-nav” which contains another div with the UL items) which has the following elements:

    Activity | Profile | Blogs() | Messages | Friends () | Groups () | Settings.

    I’m trying to work out how and where that is generated so that I can modify it (for example, omit ‘blogs’ which my users won’t have) and also to re-use it elsewhere.

    I’m using a theme which uses it as-is in the header, for example.

    But what I want to do, specifically, is to create a main navigation bar for my pages which looks something like this (reading down rather than across as it will appear):

    Home
    Community
    — Activity
    — Groups
    — Members
    — etc.
    Your pages
    — Your activity
    — Your groups
    — Friends
    — Messages
    — Settings
    About

    How do I extract some of those user-specific navigation elements to be able to use them in my menus? (And, where best-practice-wise should I do it? Presumably altering the buddypress files directly is a no-no.)

    I’d be really grateful if someone could give me some pointers as to how it works to get me started. I’ve been digging around but am finding this bit a little opaque.

    Thanks!

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

  • nigelanderson
    Member

    @nigelanderson

    Partly answering my own question, from the default buddypress theme I’ve found that the navigation strip is generated by this bit of code:

    <div class="item-list-tabs no-ajax" id="object-nav">
    <ul>
    
    </ul>
    </div>

    Could someone explain a little about how this works? I’ve located bp_get_displayed_user_nav() in the bp-core-templatetags file. I’m not sure about the next line.

    Thanks!


    nigelanderson
    Member

    @nigelanderson

    I’ve made some headway but still need help if anyone is able…

    I’ve been editing the CSS of my child theme to simply set the display property of the items I want to omit (eg ‘blogs’) to ‘none’ so that they do not show up.

    I have also used this to add the logged-in-user-specific links I want to my navigation bar:

    <li><a href="#"></a>
    <ul>
    
    </ul>
    </li>

    which now displays. I don’t have fine control over it, eg changing the text or altering the order, though I can live with that. But, my CSS trick of locating the element’s id and setting its display property to none doesn’t work in my drop-down menu.

    It seems as if I need to actually have bp_get_displayed_user_nav() return a different list than it does by default.

    Any ideas?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customizing profile page navigation strip’ is closed to new replies.
Skip to toolbar