Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

problems with cb:if

  • jciconsult
  • jciconsult
  • OFFLINE
  • Posts: 57
  • Thanks: 2
  • Karma: 10
11 years 3 months ago #231098 by jciconsult
problems with cb:if was created by jciconsult
I am in Joomla 3.1.1.
I have version 2.2.0 of the cb_content bot installed.
the bot is processing this text but the if is failing. Neither line is showing but on my old site, this worked. If someone was not logged in, the first line should show.
What am I missing?
{cb: [cb:if user="#displayedOrMe" user_id<="0"]You must login to see the link.[/cb:if]}

{cb: [cb:if user="#displayedOrMe" user_id>"0"]Here are the workshop charts of the results to date. The link will work only if you are a registered member and have logged in.[/cb:if]}

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 3 months ago #231111 by krileon
Replied by krileon on topic problems with cb:if
It looks correct, what is the difference between your new and old site? Different Joomla versions? Different CB versions? Try outputting [user_id] to maybe see what value it's seeing.


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.

  • jciconsult
  • jciconsult
  • OFFLINE
  • Posts: 57
  • Thanks: 2
  • Karma: 10
11 years 3 months ago #231112 by jciconsult
Replied by jciconsult on topic problems with cb:if
This is joomla 3.1.1 the other site was 2.5.x As far as I can see, the new site has your latest code and the latest versions of the required plugins.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 3 months ago #231119 by krileon
Replied by krileon on topic problems with cb:if
Have taken a look and it's due to Joomla encoding > and <. The below appear to work fine (no one will ever have a user id less than 0).

{cb:[cb:if user="#me" user_id="0"]You are not logged in.[/cb:if]}
{cb:[cb:if user="#me" user_id!="0"]You are logged in.[/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.
The following user(s) said Thank You: jciconsult

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

  • jciconsult
  • jciconsult
  • OFFLINE
  • Posts: 57
  • Thanks: 2
  • Karma: 10
11 years 3 months ago #231120 by jciconsult
Replied by jciconsult on topic problems with cb:if
This shows the user id. I put it in an article and it showed the correct id.
Here is user_id {cb: [user_id]}

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

  • jciconsult
  • jciconsult
  • OFFLINE
  • Posts: 57
  • Thanks: 2
  • Karma: 10
11 years 3 months ago #231121 by jciconsult
Replied by jciconsult on topic problems with cb:if
if there a field to return usergroup?

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

Moderators: beatnantkrileon
Powered by Kunena Forum