Any way to remove GUID from Groups URL

Right now,

the groups URL is like .../pg/groups/GUID/GroupName/...

is there any way to omit that GUID?  I know the groupprofile.php needs the GUID to get the Group Entity. Is there any function to get the Group Entity from just GroupName? Maybe something new in 1.7?

  • Group names are not unique so the guid needs to be in the URL (or a plugin added to ensure group names are unique).

  • Cash,

    Thanks for your reply...i understand that Group names need to be unique. In my plugin, the group name will be unique..and only created by Admin.  How would i go about getting the Group entity..from only the Group name..is there any way?  or do you have any other suggestion?

  • Cash,

    I was trying to get something similar for Group Bookmarks URL...Again, if the Group Name is UNIQUE..how would i get something like pg/bookmarks/groupname/items...instead of pg/bookmarks/group:GUID/items...just makes it more SEO Friendly.

  • Orion9,

    This seems like a lot of work for not much payback, but the way to do it for groups would be to over-ride the groups page handler like this:

    // Register a page handler, so we can have nice URLs

    register_page_handler('groups','myplugin_groups_page_handler');

    and then rewrite the groups_page_handler function to calculate the group_guid from the name rather than extracting it from the $page structure.

    Make sure your plugin is ordered after groups and it should work.

    You can do something similar for bookmarks.

  • Kevin,

    Any idea how you would go about calculating the Group_Guid from the name?  All the examples i have looked at already know the GUID...but is there a function to go from Groupname->GUID?

    Thanks for your help.

     

  • My situation is exactly opposite.
    Because my community are mostly non-English users, so I want to remove the groupsname form URL.
    It seems easy, which files should I to modify?

  • search for the function groups_url() in the group's start.php - remove the title there

  • Got it. Thanks, Cash.