cbSubs substitutions question

2 years 3 months ago #327981 by liaskas
Replied by liaskas on topic cbSubs substitutions question
Hello again...

I am trying and testing for many hours searching the forum and the cb substitutions tutorial. I did not manage to fix what i want but i found what is going on.

The closest approach to what i want is the example that you have in your substitution tutorial...
[cb:if usergroup includes "2"]I have Registered Usergroup[/cb:if]

Well this is wrong... at least on my site. This should be...
[cb:if usergroup includes "2"]The displayed user has Registered Usergroup[/cb:if]

I tested it with many users and this is exactly what i get. [cb:if usergroup includes "2"] refers to the displayed user.

Then i tried the following... tested with User in Registered usergroup (id 2)
[cb:if user="#displayed" usergroup="2"]Testing if this message displays for registered user.[/cb:if]

Viewing his profile shows nothing!

I modify the substitution and make it not equal to 2...
[cb:if user="#displayed" usergroup!="2"]Testing if this message displays for registered user.[/cb:if]

Viewing his profile the message shows fine.

I am stack! I do not understand what made my site not to deal with substitutions correctly! I used the same substitutions on my previous JOOMLA 3 site without problems.

Now on a JOOMLA 4 site i have the above issues.

Can you please advise?

Thank you.

Please Log in to join the conversation.

2 years 3 months ago #327988 by krileon
Replied by krileon on topic cbSubs substitutions question
What user is used in the substitution is entirely subjective to where the substitution even is. Where are you using this substitution? In a Custom HTML field? In an auto action? In a CBSubs plan description? As a general rule fields default to the profile owner for substitutions while everything else typically defaults 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 to join the conversation.

2 years 3 months ago #327991 by liaskas
Replied by liaskas on topic cbSubs substitutions question
The substitution is in a Custom HTML field. Then the custom HTML field is passed to the Activity tab description lile this:

fieldname: cb_field

[cb:if reason="profile"][cb:userfield field="cb_field" /][/cb:if]

What we need is [cb:userfield field="cb_field" /] to return data of the viewing user.

Thank you

Please Log in to join the conversation.

2 years 3 months ago #327995 by krileon
Replied by krileon on topic cbSubs substitutions question
That should substitute based off the profile displayed by default. If you want viewing user then add user="#me" to your field substitution. So for example the below should work.

[cb:userfield field="cb_field" user="#me" /]


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.

Moderators: beatnantkrileon
Time to create page: 0.211 seconds

Facebook Twitter LinkedIn