Conditional Display based on URL

4 years 11 months ago #311752 by AdinaG
Conditional Display based on URL was created by AdinaG
Hi

I purchased the CB Conditional and was hoping this feature would be available... but I'm not seeing it.

I have my site broken up in different directories with CB on one by itself.

From there I have other directories that are pulling the data from the CB database tables.

Everything works great but there's a little hiccup that I need help with.

I need to be able to hide tabs on the edit profile page based on which "directory" the are on.

Here's an example of what I need...

Upload Canvas should NOT be visible on CB directory, we'll call this url mysite.com/communitybuilder
Upload Canvas SHOULD display on directory 1, we'll call this mysite.com/directoryone
Upload Canvas should NOT display on directory 2, we'll call this mysite.com/directorytwo
Upload Canvas SHOULD display on directory 3, we'll call this mysite.com/directorythree

The reason I can't allow them to upload an image on the CB directory is because the images will not upload or pull correctly because the URL used uses the directories main url.

The idea would be to either enter part or whole URL, NOT a menu item.

Is there any way to do this or can you add the option of URL to the condition field?

Your assistance is greatly appreciated!

Thanks
Adina

Please Log in to join the conversation.

4 years 11 months ago - 4 years 11 months ago #311754 by AdinaG
Replied by AdinaG on topic Conditional Display based on URL
.... sorry thought I had it...

Still need help, sorry

Please Log in to join the conversation.

4 years 11 months ago #311761 by krileon
Replied by krileon on topic Conditional Display based on URL
CB Conditional supports substitutions and you can substitute in the sites URL with [cb:config param="live_site" /]. Using this you should be able to condition how you're needing. Example as follows.

Field: Custom > Value
Custom Value: [cb:config param="live_site" /]
Operator: Does Contain
Value: directoryone

If you need to match against multiple values you'll need to use REGEXP. Example as follows.

Field: Custom > Value
Custom Value: [cb:config param="live_site" /]
Operator: Is REGEX
Value: /directoryone|directorytwo/

See the below for further substitution usage information.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-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.
The following user(s) said Thank You: AdinaG

Please Log in to join the conversation.

4 years 11 months ago - 4 years 11 months ago #311781 by AdinaG
Replied by AdinaG on topic Conditional Display based on URL
This is perfect and will definitely work for several things

BUT in my research on how to handle my image issues I'm questioning if I should use the CB Replacer Bot instead...

If I have my main mysite.com/communitybuilder be the central place to upload the profile photos and headers, can I use the CB replacer on the other directories to pull the profile photos from there instead?

I was looking at another plugin (ReReplacer) that does this but was wondering if your plugin would do it?

Thanks for you help!

Adina

Please Log in to join the conversation.

4 years 11 months ago #311788 by krileon
Replied by krileon on topic Conditional Display based on URL
I would just use htaccess with mod_rewrite and point the mysite.com/directoryone/images/comprofiler folder to mysite.com/communitybuilder/images/comprofiler. If all the file storage is always on communitybuilder it's what you'll need to do to ensure media loads in. That folder is used for avatars, CB Gallery, file fields, etc.. all media storage for CB is placed there. Might be best to just do that for the entire image folder in fact. Trying to do this inline with CB Replacer Bot or similar plugins will be a nightmare of configuration as it'd need to be done on every single live media path, which isn't realistically doable.


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.

4 years 11 months ago #311791 by AdinaG
Replied by AdinaG on topic Conditional Display based on URL
:cheer: Great Idea! Ill try that first to see if it works.

THANK YOU!

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.517 seconds

Facebook Twitter LinkedIn