[SOLVED] Substitution bug & help

12 years 5 months ago - 12 years 5 months ago #183523 by krileon
Replied by krileon on topic Re: Substitution bug & help
What type of field is cb_selecttyp? Is it being controlled by CB Conditional or CBSubs? userfield will respect privacy so if it's display is being hidden by something then it won't return anything. This shouldn't affect IF statements though as it's using the same code as userdata, which you state works. I suspect perhaps the condition it self (="MyTestValue") isn't correct. I couldn't duplicate your issue however and see IF statements working fine.


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.

12 years 5 months ago #183525 by pepperstreet
Replied by pepperstreet on topic Re: Substitution bug & help
Thanks for testing. Mmh, what should I say, its a simple select field. Really simple one-word test entries. As you mentioned, the "userdata" variant does show-up. The "userfield" test is just a copied version, where I replaced the "data" against "field"...

I am clueless.

If you say its working on your side, i am fine. Maybe its "one-of-these-days" things ;-)
Will check it again, but I don´t see anything else to try.

However, its not sooo important. I can live with it. As far as alternative syntax works.

Please Log in to join the conversation.

12 years 5 months ago - 12 years 5 months ago #183526 by pepperstreet
Replied by pepperstreet on topic Re: Substitution bug & help
Just one question from my first post:
Since the userdata syntax works for the simple output, how would I use this syntax in an IF STATEMENT ?!?
I wanted something like:

IF the displayed user has a special simpleselect value THEN display a special image (badge)

Is this simple version correct?
[cb:if cb_selecttyp="MyTestValue"]Show me this sample text.[/cb:if]

Is it possible to write the same example with "userdata" ? Just want to have a comparison.

Please Log in to join the conversation.

12 years 5 months ago - 12 years 5 months ago #183528 by krileon
Replied by krileon on topic Re: Substitution bug & help

Is this simple version correct?
[cb:if cb_selecttyp="MyTestValue"]Show me this sample text.[/cb:if]

Yes, but it depends on the type of field. If it's a multi-select the above is not correct. If it's a single select drop-down then the above is correct. This all assumes the value you are matching against is actually the exact value stored to database for the user.

I need to know the exact fieldtype and the exact value you want to match against. I can't test and confirm or suggest configuration otherwise.

Is it possible to write the same example with "userdata" ? Just want to have a comparison.

In source it already uses userdatas 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.
The following user(s) said Thank You: pepperstreet

Please Log in to join the conversation.

12 years 5 months ago #183536 by pepperstreet
Replied by pepperstreet on topic Re: Substitution bug & help
Tested again with new SINGLE SELECT field.
Values are really simple:

Avalue
Bvalue
Cvalue

I tried again these two tests in a delimiter:

[cb:userfield field="cb_selecttyp" /]
[cb:userdata field="cb_selecttyp" /]

Result in frontend:

[cb:userfield field="cb_selecttyp" /]
Bvalue

Please Log in to join the conversation.

12 years 5 months ago - 12 years 5 months ago #185763 by pepperstreet
Replied by pepperstreet on topic Re: Substitution bug & help
Still problems with substitutions in Delimiter field. Testing with CB 1.7.1 and J! 1.5.25. I have 2 different local installations, to make sure its not related to one particular setup.

I also wanted to make sure that i don´t have a general Syntax problem, so I tested with your simple IF examples from your tutorial page. Simple IFs and userdata seems to work fine.

[cb:if user="#displayed" usertype="Registered"] The displayed user is of type: [cb:userdata field="usertype" /] (without OR operator)[/cb:if]


As soon as I try to do an IF OR combi... it does not output anything.

[cb:if user="#displayed" usertype="Registered" OR usertype="Editor"] The displayed User is of type: [cb:userdata field="usertype" /][/cb:if]


My current goal: I wanted to have a field value displayed to the PROFILE OWNER and ADMIN only. Nobody else. The original field lives on another Tab... I display it in a DELIMITER in another profile area, and wanted to restrict the visibility. The actual info is just for the owner or administration.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.212 seconds

Facebook Twitter LinkedIn