[SOLVED] Use of url location in cb contentbot

11 years 6 months ago - 11 years 6 months ago #214593 by nickr
I'm trying to use 'url location' in a cb:if statement - is this possible? I've tried the following:

[cb:if url location="profile_view"]content to display[/cb:if]

It doesn't work for me though. If I try just a [cb:url location="profile_view" /] it displays the url of "http://MYSITE/index.php/profile" as I'd expect it to.

If this isn't possible then perhaps you can suggest another option (or you might have a better idea anyway). I have social sharing buttons on profile pages and they work fine if you are on someone elses profile page. If you are on your own page though the URL is "http://MYSITE/index.php/profile" and this is obviously no good for sharing as it doesn't go to the relevant user's profile page (which end with 'userprofile/[username]'). I need somehow to make sure that the user profile page for someone looking at their own page is always the full profile URL.

Help appreciated.

Please Log in to join the conversation.

11 years 6 months ago #214609 by krileon
Replied by krileon on topic Re: Use of url location in cb contentbot
No such IF substitution exists. The below are the only URL substitutions available and they're strictly used to output the URL for usage; they can not be used in IF statements.

[cb:url location="DESTINATION" /]

Please review the below substitution usage tutorial carefully.

www.allmysocials.com/directory/tutorials/item/233-substitution-usage

If this isn't possible then perhaps you can suggest another option (or you might have a better idea anyway). I have social sharing buttons on profile pages and they work fine if you are on someone elses profile page. If you are on your own page though the URL is "MYSITE/index.php/profile" and this is obviously no good for sharing as it doesn't go to the relevant user's profile page (which end with 'userprofile/[username]'). I need somehow to make sure that the user profile page for someone looking at their own page is always the full profile URL.

You can ensure the substitution only renders if the use is viewing themselves with the below.

[cb:if user_id="myid"]This is Me being displayed.[/cb:if]


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 to join the conversation.

11 years 6 months ago #214611 by nickr
Replied by nickr on topic Re: Use of url location in cb contentbot
Okay - that's what I thought. I am already using the user_id="myid" code to ensure only they see the specific text.

Is there perhaps another option to force a redirect from "MYSITE/index.php/profile" to "MYSITE/index.php/profile/userprofile/[username]" so that they always get the full URL showing?

Thanks.

Please Log in to join the conversation.

11 years 6 months ago #214624 by krileon
Replied by krileon on topic Re: Use of url location in cb contentbot
No not without causing a bunch of problems. It's better to just fix your share buttons to use a static URL with username or user id already in it. For example if the button is just HTML then social sites let you specify the URL manually, which you can construct the URL anyway you like with substitutions.


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: nickr

Please Log in to join the conversation.

11 years 6 months ago #214647 by nickr
Replied by nickr on topic Re: Use of url location in cb contentbot
Okay - thanks Kyle.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.311 seconds

Facebook Twitter LinkedIn