Skip to Content Skip to Menu

Unclear how to set IF substitution

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
10 years 6 months ago #244515 by dotcom22
Unclear how to set IF substitution was created by dotcom22
hello

I have CB Content module with inside only [cb:if cb_getsubiddelimi="2"]My text[/cb:if].
When the condition is meet, I would like show the text on all pages EXCEPT on my own view/edit profile. If I set the module to not be published on view/edit profile menu item this work but the text is of course also hidden when I'm on any other users profile.

I played for a while with substitution without found the right solution. :blink: I don't know if this is possible to do.

Any clue please ?

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 6 months ago #244571 by krileon
Replied by krileon on topic Unclear how to set IF substitution
The substitutions work different based off their location. In the case of the CB Content module it needs to know what user you want the substitutions to apply to. So your IF conditional should specify the target user as follows.

[cb:if user="#me" cb_getsubiddelimi="2"]My text[/cb:if]

That should ensure the substitution always applies to the viewing user.


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.

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
10 years 6 months ago #244595 by dotcom22
Replied by dotcom22 on topic Unclear how to set IF substitution
I tested:

#me = module is displayed on all pages and profile

#displayed = module is hidden on all pages and profile (including my own Edit profile page) but is displayed on my own profile

#displayedOrMe = module is hidden on all pages and profile

Any clue ?

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 6 months ago #244617 by krileon
Replied by krileon on topic Unclear how to set IF substitution
#me = User viewing
#displayed = User displayed
#displayedOrMe = User displayed otherwise user viewing

With that said #displayed will only work on CB profiles or anywhere that fires the API call to set the displayed user. #displayedOrMe or supposed to be both with priority for the displayed user and fallback to viewing user.

To have the condition you're wanting I believe the below should work ok.

[cb:if user="#displayed" user_id!="myid" cb_getsubiddelimi="2"]My text[/cb:if]

That's only going to display on CB profiles though and only if the user id of the displayed user doesn't match the user id of the viewing user. I'm not entirely sure you can have the exact condition you're wanting.


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.

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
10 years 6 months ago #244642 by dotcom22
Replied by dotcom22 on topic Unclear how to set IF substitution
I tried your suggestion but the module does not appear on any pages.

I'm not entirely sure you can have the exact condition you're wanting.


It seem CB Content do not support fully substitution like in user profile. Ok is not a big deal even if I wanted get a customized message in a special case. Except if you have another suggestion, I will abandon.

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 6 months ago #244652 by nant
Replied by nant on topic Unclear how to set IF substitution

dotcom22 wrote: I tried your suggestion but the module does not appear on any pages.


The module appearance is based on the Joomla ACL setup that you have configured.

Once the module appears then the code in the module wil lbe executed to filter the message based on viewer.

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

Moderators: beatnantkrileon
Powered by Kunena Forum