Skip to Content Skip to Menu

Substitutions question

  • siala
  • siala
  • OFFLINE
  • Posts: 26
  • Thanks: 1
  • Karma: 0
7 years 11 months ago #287442 by siala
Substitutions question was created by siala
I'm trying to add some cb fields to an article. I have single statements working but does CB substitutions support multiple cb:if statements? For example:
Code:
[cb:if cb_field1 != "N"] [cb:if cb_field2 != "N"] some text [cb:if cb_field3 != "N"] some more text [/cb:if] [/cb:if] [/cb:if]


Joomla! Version 3.6.2 Stable [ Noether ] 4-August-2016 23:41 GMT
PHP Version 5.6.24
mysql version 5.6.32-78.1
community builder version 2.0.15+build.2016.09.18.15.00.02.b2e3df5e1

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48437
  • Thanks: 8275
  • Karma: 1443
7 years 11 months ago #287459 by krileon
Replied by krileon on topic Substitutions question
Nested substitution IF usages are not supported at this time, but they will be. It has already been implemented, but the merge into core code is pending further review as it's a pretty big change. In addition to nested substitution IF usages there will be support for ELSEIF and ELSE usages.

You can however have additional conditions on a single IF substitution. Example as follows.

Code:
[cb:if cb_field1 != "N" and cb_field2 != "N"]some text[/cb:if] [cb:if cb_field1 != "N" and cb_field2 != "N" and cb_field3 != "N"]some more text[/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 or Create an account to join the conversation.

  • siala
  • siala
  • OFFLINE
  • Posts: 26
  • Thanks: 1
  • Karma: 0
7 years 11 months ago #287493 by siala
Replied by siala on topic Substitutions question
thanks. good to hear.

another question. im creating an article that uses cb substitutions. this article is accessible from a profile. i want the article to use the field values from the profile that was being viewed. this works fine when the logged in user accesses the article from their own profile but not when they view it from a different profile.

is there a way of passing the cb userid or username to the article so i can use the cb user parameter to show the field values from the profile that is being viewed and not the logged in user? Or is there an easier way to do this?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48437
  • Thanks: 8275
  • Karma: 1443
7 years 11 months ago #287498 by krileon
Replied by krileon on topic Substitutions question

another question. im creating an article that uses cb substitutions. this article is accessible from a profile. i want the article to use the field values from the profile that was being viewed. this works fine when the logged in user accesses the article from their own profile but not when they view it from a different profile.

Substitutions in an article will be of the article owner or whoever is viewing the article. There's no way to know what profile the user came from.

is there a way of passing the cb userid or username to the article so i can use the cb user parameter to show the field values from the profile that is being viewed and not the logged in user? Or is there an easier way to do this?

Nope.


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