Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

CB conditional: dependent on Name of website or URL?

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
5 years 10 months ago #309699 by timstohr
Hi Kyle,
For some weird reason where I do not want to get in details here (Multi-site arrangement...), I have to condition several tabs according to site name or the URL of the website.
ie: when you look at a profile on site blog.international-friends.net/ (site name: International Friends News), then it needs to show the tabs "Who I am?" and "Why am I writing?" while this tab should not be visible on the International Friends Munich site ( munich.international-friends.net/ ).

Any idea how to do that? Is there a string or something we can condition on?

Kind regards,

Tim

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
5 years 10 months ago #309709 by krileon
You can substitute in the site name with [cb:config param="sitename" /] and its URL with [cb:config param="live_site" /]. You can then condition against them using Custom > Value conditions. No clue if either will output correctly with your multi-site usage.


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.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
5 years 10 months ago #309761 by timstohr
Love the versatility of CB conditional. Trying it out right now!

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

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
5 years 10 months ago #309762 by timstohr
WORKS!
I have a question though about the efficiency. Lets say I have 300 sites. On 299 I do not need to show the tab "About me!" while on 1 I need to show it.
How badly (if at all) will it affect the performance of the other 299 sites if I condition this one site to show tab only when live site is equal to blog.international-friends.net/ ?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
5 years 10 months ago #309772 by krileon
The conditions are stored as part of the field so there's no additional storage access. CB already uses user object caching and the substitution you're using doesn't access the user object as it's just a configuration value. So basically the only overhead is looping through and checking the string comparison, which is little to nothing. In short you should have no performance issues. You should only need 1 condition though and that's to check for that 1 site as conditions reverse if they don't pass (e.g. if you have it conditional show it will hide if the condition fails)/


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

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

Moderators: beatnantkrileon
Powered by Kunena Forum