Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom slugs not working


  • Florian
    Participant

    @gquann

    Hello,

    I’m trying to change a few of BuddyPress’ slugs. For example, I added the following line to my wp-config.php:

    define ( ‘BP_MEMBERS_SLUG’, ‘mitglieder’ );

    Unfortunately, this does not seem to have any effect whatsoever. What am I doing wrong? Do I need to add this option elsewhere?

    Greetings,

    Florian

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

  • Burt Adsit
    Participant

    @burtadsit

    Create a file called bp-custom.php in /wp-content/plugins put your slug mods there. This gets loaded everytime bp loads.

    It should work fine in wp-config.php, it does for this site at least and a couple of other test sites I run.


    Florian
    Participant

    @gquann

    I added the same options in bp-custom.php and now it works. Thanks, Burt!

    But new problems arose: When I change BP_XPROFILE_SLUG, the profile is not accessible anymore because it results in an infinite redirection loop.

    Also, all navigation icons of slugs that I changed disappear. The default member theme seems to generate the list ids from the slugs. So now li#my-friends becomes li#my-freunde and the corresponding css breaks. I can easily change that, but wouldn’t it be better for the default theme to use fixed ids?


    Florian
    Participant

    @gquann

    Another problem: In the global activity widget which is displayed on the home page, only the first two entries use the updated member slugs. The older ones still use the old ones which results in broken links. The same problem occurs in the activity rss feed. Any idea why this may be?


    Burt Adsit
    Participant

    @burtadsit

    Let’s start with the easy one first. The css issue is due to the fact that the css must be hard coded in the actual css files. You need to override the standard css in your theme to reflect the fact that your elements such as #my-friends are now #my-freunde. When you are updating the css in your theme you’ll see where the icons are based on the css selectors.

    The activity that you see is stored in tables and then displayed. It stores the slug you changed for the component in the activity table. Changing the component slug means that the new activity works and the older activity that refers to the default slug doesn’t work.

    I don’t have any immediate answer for the infinite recursion issue when changing the profile slug.


    Burt Adsit
    Participant

    @burtadsit

    What version bp and wpmu are you using Florian? I can’t reproduce the infinite loop problem.


    Florian
    Participant

    @gquann

    Yes, fixing the css is easy. I just think it would be easier for everyone if the element ids would not be named dynamically. I see no reason to change the css id when the slug changes. Making them static would make changing slugs way easier.

    But this is only a suggestion for a general improvement of the default theme. Personally, I already adjusted my css. :)

    Glad to hear that the activity links will be all right for new activities. Thanks for the info!

    I’m using WPMU 2.7.1 and BP 1.0.1


    Florian
    Participant

    @gquann

    Uhm… I just joined and left a group for testing and all that shows up on the activities is blank space. In the feed, there is just an empty item with only the date set. Additionally, this error showed up when I left the group:

    Fatal error: Call to undefined function get_group_avatar_thumb() in /[path to WPMU]/wp-content/plugins/buddypress/bp-groups/bp-groups-templatetags.php on line 309


    Florian
    Participant

    @gquann

    New friendships also leave an empty space.


    Florian
    Participant

    @gquann

    Removing the custom groups slug brought back the activity, but not the friendships activity. Removing the custom members slug brought back the friendship activity.

    I think I’ll abondon the custom slugs for now, because they are causing too much trouble.


    David
    Participant

    @educartis

    i have the same problem Florian, and my solution was the same of yours,. not to change slugs at this moment,.. its a pitty.


    David
    Participant

    @educartis

    Oooppss reading a blog post ive found a solutions that is working properly,.. in the bp-custum.php we need to comment or delete this sentence:

    define ( ‘BP_XPROFILE_SLUG’, ‘info’ );

    Before

    >>>

    01.define ( ‘BP_ACTIVITY_SLUG’, ‘streams’ );

    02.define ( ‘BP_BLOGS_SLUG’, ‘journals’ );

    03.define ( ‘BP_MEMBERS_SLUG’, ‘users’ );

    04.define ( ‘BP_FRIENDS_SLUG’, ‘peeps’ );

    05.define ( ‘BP_GROUPS_SLUG’, ‘gatherings’ );

    06.define ( ‘BP_MESSAGES_SLUG’, ‘notes’ );

    07.define ( ‘BP_WIRE_SLUG’, ‘pinboard’ );

    08.define ( ‘BP_XPROFILE_SLUG’, ‘info’ );

    10./* Some other non-component slugs */

    11.define ( ‘BP_REGISTER_SLUG’, ‘signup’ );

    12.define ( ‘BP_ACTIVATION_SLUG’, ‘enable’ );

    13.define ( ‘BP_SEARCH_SLUG’, ‘find’ );

    14.define ( ‘BP_HOME_BLOG_SLUG’, ‘news’ );

    Ive tried and know everything looks nice,,

    This solutions is in the comments of this post

    https://buddypress.org/blog/how-to/customizable-slugs-in-buddypress/#comments

    Hey guys, I think, I finally found out the solution to the BP_XPROFILE_SLUG problem !

    In your bp-custom.php or wp-config.php files, let’s say you write : define ( ‘BP_XPROFILE_SLUG’, ‘myvalue’ );

    Then, you also have to write : define( ‘BP_DEFAULT_COMPONENT’, ‘myvalue’ );

    …otherwise your custom BP_XPROFILE_SLUG won’t work, and neither will the “My account” nor “Random member” links.

    Hope this helps :)

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Custom slugs not working’ is closed to new replies.
Skip to toolbar