Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Specific Dynamic Link from Username


  • johnsorci
    Participant

    @johnsorci

    On my site, I would like to add a buddypress navigation link that goes to a specific page based on the logged in username.

    For example, “johnsorci” would be logged in, and I would like a navigation link that would direct them to “www.example.com/artists/johnsorci”.

    This is not a link to their profile, as I already have that. But each user has their own page in the “artists” section, and I want a link that would take the logged in user to that page.

    Thanks for any help!

Viewing 11 replies - 1 through 11 (of 11 total)
  • I don’t think this is possible without writing some custom code at the moment, but yeah, I want to add something like this into a future version of BP, too 🙂


    johnsorci
    Participant

    @johnsorci

    I don’t mind if I have to code something, I just don’t know a good basis of where to start…


    danbpfr
    Participant

    @chouf1

    @johnsorci, where should be this link ?

    On the Toolbar, under the howdy menu ?


    johnsorci
    Participant

    @johnsorci

    In the buddypress menu on a users profile page. Where it has “Activity, Profile, Friends, Groups, etc.”

    http://doodlesncompany.com/members/blythedockham/profile/


    danbpfr
    Participant

    @chouf1

    ok.

    Are you on a single or multisite install ?
    is /artists/ a post category ?
    Or do you create a “page” for each artist ?
    Do you use the by default  first name last name or do you use a specific registering plugin ?


    johnsorci
    Participant

    @johnsorci

    I would be okay with it being a post category, or a specific page that I would create. If it was a page that I created, I would make it match identically to their username, so if I created the dynamic link with PHP it would work properly.


    danbpfr
    Participant

    @chouf1

    @johnsorci,

    this will let you create a page for each user titled by username.
    If the user entered in the default BP profile name field Johnny, you create a page titled Johnny (case sensitive)
    The button in the code is named “artist page”, change it to your convinience
    The link title is named “Johnny’s page”, can also be changed.

    http://bp-fr.net/BuddyBin/?46d87fc956b8ccc9#/KMARTQxuEvpq+48vEBDWUuvlh4pJajVaiQ+mCU2rIc=


    johnsorci
    Participant

    @johnsorci

    Thank you so much! It’s perfect! 🙂


    Scotm
    Participant

    @scotm

    This is a great mod I must say. What happens though if a user changes their username in the profiles settings?

    Also, as I understand it, you still need to create the page with the username. It would be exceptional if there was some way to create the dedicated page automatically upon registration, otherwise users might click on the tab and it doesn’t yet exist.


    johnsorci
    Participant

    @johnsorci

    @chouf1

    I have one more question with this. The problem that I am having is that the code is pulling the FULL NAME of a user, which has spaces in it. Is it possible to have the code put a “-” instead of the space, or to reference their USERNAME instead of Full Name?

    Thanks


    johnsorci
    Participant

    @johnsorci

    I think I solved it.

    I changed “bp_get_displayed_user_fullname().” to “bp_get_displayed_user_username().”

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Resolved] Specific Dynamic Link from Username’ is closed to new replies.
Skip to toolbar