Skip to Content Skip to Menu

Passing a variable in the URL

11 years 10 months ago #231376 by rosshennessy
Passing a variable in the URL was created by rosshennessy
Hi,

I have added a variable to the URL like this:
Viewing own Profile
example.com/index.php?option=com_comprofiler&Itemid=113&b=1

Guest viewing the Profile
example.com/index.php?option=com_comprofiler&task=userprofile&user=807&Itemid=113&b=1

When I turn on SEF URLs I get this:
Viewing own Profile
example.com/index.php/members&b=1

Guest viewing the Profile
example.com/index.php/members/userprofile/807&b=1

The variable b= is used to load different content.

With the SEF URLS on, and viewing own profile a 404 - Article not found error is given.

And when viewing as guest the variable no longer works, but the page loads.

Is there a way to get this working with SEF URLS on.

It works fine with SEF URLs off.

Thanks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 49297
  • Thanks: 8426
  • Karma: 1465
11 years 10 months ago #231394 by krileon
Replied by krileon on topic Passing a variable in the URL
First variable of a URL should be ?b=1 not &b=1. Are you manually constructing the SEF URL? Always supply the URL as non-SEF and let Joomla format it. For example the below will work fine.

example.com/index.php/members/userprofile/807?b=1


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.

11 years 10 months ago #231401 by rosshennessy
Replied by rosshennessy on topic Passing a variable in the URL
Hi,

This is the way it is constructed:
Viewing own Profile
example.com/index.php?option=com_comprofiler&Itemid=113&b=1

Guest viewing the Profile
example.com/index.php?option=com_comprofiler=807&Itemid=113&b=1

But SEF then changes it to:
Viewing own Profile
example.com/index.php/members&b=1

Guest viewing the Profile
example.com/index.php/members/userprofile/807&b=1

The ?option= has the ? that is why I had the &

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 49297
  • Thanks: 8426
  • Karma: 1465
11 years 10 months ago #231405 by krileon
Replied by krileon on topic Passing a variable in the URL
I don't know what more to advise then. CB is not responsible for the extra variables or the SEFing of the URL. That's entirely handle by Joomla. Are you using a 3rd party SEF extension? If so try disabling it and using Joomla SEF only.


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