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. 31)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

profile SEF url and Itemid

  • ndee
  • ndee
  • OFFLINE
  • Posts: 25
  • Thanks: 5
  • Karma: 19
13 years 7 months ago #163200 by ndee
profile SEF url and Itemid was created by ndee
Hi,

if I disable SEF in Joomla 1.5 and generate a link to a users profile a custom Itemid works:
Code:
$profilelink = JRoute::_('index.php?option=com_comprofiler&task=userProfile&user='.$user->user_id.'&Itemid='.$itemid);

the generated url looks like this:

example.com/index.php?option=com_comprofiler&task=userProfile&user=122&Itemid=5

(my custom itemid works and the right menu item is set to active)

the SEF version of above example should look like this:

example.com/my-menu-item/username.html


but it looks like this:

example.com/component/comprofiler/userprofile/username.html


so, the itemid is got lost somewhere.

Can you give me a hint where to look to fix this? or overwrite CB standard behaviour?

Thanks.

greets

###################
SPEED UP HELP, read first: Help us help you
###################

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
13 years 7 months ago #163343 by krileon
Replied by krileon on topic Re: profile SEF url and Itemid
Joomla SEF links often don't contain the Itemid. For example mouseover my avatar image to the left of any of my posts and no Itemid is appended. This is all done internally by Joomla out of view. Custom Itemid is not valid, if it doesn't match an existing database entry (an actual Menu link) then Joomla strips it. External menu links will also have Itemid stripped by SEF. All of which not controlled by CB.


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.

  • ndee
  • ndee
  • OFFLINE
  • Posts: 25
  • Thanks: 5
  • Karma: 19
13 years 7 months ago #163433 by ndee
Replied by ndee on topic Re: profile SEF url and Itemid
Hi Kyle,

that's not the case. Actually in above example Itemid=5 is the menu entry "my-menu-item". The menu entry exists.

It seems that CB strips out the Itemid when viewing a users profile. I tried to use cbsef instead of Joomlas JRoute, same effect.

Afaik, the component itself is responsible for parsing the route. As mentioned above the link is a CB one: "index.php?option=com_comprofiler&task=userprofile&user=122&Itemid=5"
Again, the Itemid works and is not stripped out with SEF disabled and the Itemid has a related published menu entry.

###################
SPEED UP HELP, read first: Help us help you
###################

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
13 years 7 months ago #163464 by krileon
Replied by krileon on topic Re: profile SEF url and Itemid
If SEF is enabled for a URL then the Itemid will not be visible (best to test using a module that would display only on that Itemid). See many URLs on Joomlapolis it self, including your own avatar. This does not however mean it is removed. If the Itemid in question (5) is for a menu link that is External then Joomla will remove the Itemid (just how Joomla works). If trying to build a profile link you should be using CB API. See below example.
Code:
$_CB_framework->userProfileUrl( USER_ID )

This assumes you've included CB API (see tutorials within signature). Additionally you can get CBs Itemid with the below.
Code:
getCBprofileItemid()


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