Skip to Content Skip to Menu

[#4413] cb substitution for logged user

10 years 8 months ago - 10 years 8 months ago #240553 by thewebsurfer
Replied by thewebsurfer on topic cb substitution for logged user
i dont try my solution yet,
but i've another question about substitution:
i need to show the users (with usertype=visitor) some test in his profile (so just to the profile owner)

i tried this, doesnt work

[cb:if user="#me" AND cb_usertype="visitor"]
Last edit: 10 years 8 months ago by thewebsurfer.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago #240600 by krileon
Replied by krileon on topic cb substitution for logged user
You do not need the AND. Please see the below tutorial, where several examples are provided.

www.joomlapolis.com/support/tutorials/107-use-cases/18353-using-substitutions-throughout-cb

Example as follows.

[cb:if user="#me" cb_usertype="visitor"]
content here
[/cb:if]

Note the above is checking the field value of the viewing user and not the displayed 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.

10 years 8 months ago - 10 years 8 months ago #240956 by thewebsurfer
Replied by thewebsurfer on topic cb substitution for logged user

krileon wrote: You do not need the AND. Please see the below tutorial, where several examples are provided.

www.joomlapolis.com/support/tutorials/107-use-cases/18353-using-substitutions-throughout-cb

Example as follows.

[cb:if user="#me" cb_usertype="visitor"]
content here
[/cb:if]

Note the above is checking the field value of the viewing user and not the displayed user.


www.joomlapolis.com/forum/153-professional-member-support/224419-solved-malefemale-blank-avatar?start=6#240843

in IF condition i need to add an AND operator or not?
Last edit: 10 years 8 months ago by thewebsurfer.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago - 10 years 8 months ago #240984 by krileon
Replied by krileon on topic cb substitution for logged user
There is no "and" separator when defining the user. The user is the target of the substitutions. You only use it to separate multiple conditions. Examples as follows.

Do not add "and":
[cb:if user="#me" cb_usertype="visitor"]

Add "and":
[cb:if user="#me" cb_usertype="visitor" and cb_text="bob"]


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.
Last edit: 10 years 8 months ago by krileon.
The following user(s) said Thank You: nant, thewebsurfer

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

Moderators: beatnantkrileon
Powered by Kunena Forum