Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 25th)

[#4479] user ID in profile from the CB Profile menu Item

  • lylejover
  • lylejover
  • OFFLINE
  • Posts: 30
  • Thanks: 3
  • Karma: 1
10 years 7 months ago - 10 years 7 months ago #244346 by lylejover
Hi,

I noticed that there is no user id in the profile menu item for joomla. This is fine because this is working but thinking about users wanting to share their profiles, there is a big chance that they would just copy the url from their browser instead of clicking FB share or whatever social plugin.

If there is no user id, then people cannot see his profile.

Any thought on how to fix this?
Last edit: 10 years 7 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48609
  • Thanks: 8300
  • Karma: 1446
10 years 7 months ago - 10 years 7 months ago #244393 by krileon
Create a delimiter field to output a shareable link. Example as follows.

Non-SEF:
Code:
[cb:config param="live_site" /]/index.php?option=com_comprofiler&task=userprofile&user=[user_id]

SEF:
Code:
[cb:config param="live_site" /]/comprofiler/userprofile/[username]

The SEF link can be customized further if you've a menu item, which would be as follows.

SEF with Menu Item:
Code:
[cb:config param="live_site" /]/MENU_ALIAS/userprofile/[username]


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.
Last edit: 10 years 7 months ago by krileon.
The following user(s) said Thank You: nant

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

  • lylejover
  • lylejover
  • OFFLINE
  • Posts: 30
  • Thanks: 3
  • Karma: 1
10 years 7 months ago #244410 by lylejover
Replied by lylejover on topic user ID in profile from the CB Profile menu Item
Thanks Krileon! Always appreciated. I hope in the future there is a way to rewrite this URL.

Have tried JOOMSEF and you're right in your other posts, they kinda have a lot of negative impacts on CB.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48609
  • Thanks: 8300
  • Karma: 1446
10 years 7 months ago - 10 years 7 months ago #244417 by krileon
The URL is already rewritten the best it can in regards to Joomlas SEF limitations and requirements. Joomla rewrites them as follows

DOMAIN/ALIAS/VIEW/PARAMETERS

So in CBs case with a menu item you could have the following.

domain/profiles/userprofile/krileon

There's no way to reduce this any further without causing conflicts. If you remove "userprofile" then you are removing the task/view, which CB/Joomla needs to know in order to determine what you're wanting to display.

Having domain/krileon is easy to do on social sites like Facebook, but the environment is designed for it. Joomla on the other hand could have hundreds of extensions, which all have their views/tasks and menu aliases as necessary.

The only way I can think of improving this further is quite significant improvements being done to Joomlas SEF handling. For example URL rebuilding from alias could work and you'd be able to have the below.

domain/profiles/krileon

It'd then take the "profile" alias, match it against its menu alias in the database then reconstruct the request parameters back into the request global. This however is no reliable. For example what if the alias isn't unique? Then this becomes an impossible situation.

Rewriting the URL is actually the easy part, but rebuilding from the rewritten URL in a way that won't conflict with other extensions is where it gets significantly more difficult. Both tasks are done in our router.php.

Now something like the following actually is somewhat doable. However, our URL functions and routing don't account for it.

DOMAIN/ALIAS/USERNAME

This is accomplished by using the following URL structure.

index.php?option=com_comprofiler&user=USER_ID

I've created a feature ticket to look into improving our router further for better looking SEF URLs.

forge.joomlapolis.com/issues/4479


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.
Last edit: 10 years 7 months ago by krileon.

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

Moderators: beatnantkrileon
Powered by Kunena Forum