Skip to Content Skip to Menu

[SOLVED] Can Field Substitutions work if no one is logged in as a user?

9 years 6 months ago - 9 years 6 months ago #277342 by STUCKSHUTTER
This one is probably so elementary to you and others, it's probably going to seem dumb but d

Do field substitutions work if no one is signed in?

I think the answer is "no as there is no user".

If so, is there a way to set a user ID and display the data in a CB field using a tag inserted in an article? Would the userid be able to set that?

For example, if I had created a CB field called "company" and no one is logged in, how would I display the "company" field data for say user id 566?

The new version is great and I'm working on new uses for it but seem to be missing the point somewhere. If you can do this, a simple example would be most appreciated.

Thanks for your help.
Last edit: 9 years 6 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 49441
  • Thanks: 8467
  • Karma: 1465
9 years 6 months ago #277346 by krileon
If the substitution is on a users profile (e.g. Custom HTML field) the target user is typically the profile user. In that case, yes. If the substitution is outside the profile (e.g. CB Content Module) the target user is typically the viewing user. In this case, no. This is due to there being no user to substitution off of. To avoid this you can specify the user parameter on the substitution to substitute in a tab or field from a specific user if you wanted. See the below substitution tutorial for further usage information.

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

In your case you need to have an IF substitution to see if someone is a guest. If they are substitute in the field of user 566. If they aren't then substitute in the field normally. Please see the bottom of the substitution tutorial page as there are IF substitution usage examples for checking for guest, etc..


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: STUCKSHUTTER

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

9 years 6 months ago #277348 by STUCKSHUTTER
Thanks for the quick reply, perfectly clear now. I knew I had to be missing something!
Much appreciated.
The following user(s) said Thank You: krileon

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

9 years 6 months ago - 9 years 6 months ago #277365 by STUCKSHUTTER
Canceled the query, realized it should post in new query
Last edit: 9 years 6 months ago by STUCKSHUTTER. Reason: Realized query should post as new query

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

Moderators: beatnantkrileon
Powered by Kunena Forum