Skip to Content Skip to Menu

[SOLVED]SEF URLs for CB Profiles-how to configure?

  • citydan
  • citydan
  • OFFLINE
  • Posts: 44
  • Thanks: 2
  • Karma: 1
12 years 3 months ago - 12 years 2 months ago #204244 by citydan
I posted this before ( www.joomlapolis.com/forum/146-general/201838-sef-urls-for-cb-profiles-a-way-to-configure ), but would like to know if there is an answer:

On my site, user profiles have URLs like this:

mywebsite.com/profile/userprofile/Tom%20Smith



Is there a way to configure my CB URLs so that the URLs become:

mywebsite.com/profile/userprofile/Tom-Smith

or,

mywebsite.com/profile/userprofile/tom-smith

or,

mywebsite.com/profile/userprofile/TomSmith

?

I would prefer not to have spaces in the URLs.

Is CB creating a username field by copying the name field?

My CB Configuration Manager, General Settings are:
Name Style: First and Last Name Field
(which I think means that it creates a name field from the First and Last Name fields that I have in Registration)
Name Format: Name Only

I am using:
Joomla 2.5.6
CB 1.8.1
UdeIM 2.7
PHP 5.2.17
Apache
MySQL

SEO Settings:
Search Engine Friendly URLs: Yes
Use URL rewriting: Yes
Adds Suffix to URL: No
Unicode Aliases: No
Include Site Name in Page Titles: After
Last edit: 12 years 2 months ago by citydan. Reason: solved - thank you

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
12 years 3 months ago #204280 by krileon

I would prefer not to have spaces in the URLs.

Then you need to ensure spaces aren't allowed in usernames. You can configure a custom REGEX or use one of the predefined validation within the fields settings in field management.

Is CB creating a username field by copying the name field?

If username isn't shown on registration then yes. Otherwise it uses whatever the user provides.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • citydan
  • citydan
  • OFFLINE
  • Posts: 44
  • Thanks: 2
  • Karma: 1
12 years 3 months ago #204300 by citydan
So there is no setting in CB to have usernames generated as "[FIRSTNAME][LASTNAME]" without a space between them? Or to use a dash instead of a space?

I have usernames set as not editable by the user and am only asking them for FirstName and LastName for simplicity's sake. I have login set only to email and not username.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
12 years 3 months ago #204305 by krileon

So there is no setting in CB to have usernames generated as "[FIRSTNAME][LASTNAME]" without a space between them? Or to use a dash instead of a space?

No, but you can use CB Auto Actions with the after registration trigger in a Field action to do this.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: citydan

Please Log in or Create an account to join the conversation.

  • citydan
  • citydan
  • OFFLINE
  • Posts: 44
  • Thanks: 2
  • Karma: 1
12 years 2 months ago #206679 by citydan
I am configuring CB Auto Actions now to change people's username field from
'firstname lastname' (which makes the current profile URL like "/profile/userprofile/Dan%20Wood")
to 'firstname-lastname' (to make their profile URL like "/profile/userprofile/Dan-Wood")

In CB Auto Actions I have:
Type: Field
Triggers: onAfterUserRegistration,onAfterLogin,onAfterUserUpdate
User: Automatic
Access: Everybody
Conditional: null
Field Action:
Field: User Name
Operator: Set (Field = Value)
Value: [firstname]-[lastname]

Before I publish this, I would like your opinion if it will work or not
Are my values correct?

Additionally, is there a way to transform the case so the URL is "/profile/userprofile/dan-wood"? And to prevent

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
12 years 2 months ago #206699 by krileon
Looks correct, but you probably don't want the onAfterLogin as it'll update the username field after every login for every usage. After profile update and after registration is sufficient. To fixing existing users just make the change manually or do a database query to _users to adjust them all at once.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum