Substitution problem in HTML field

1 week 4 days ago #331745 by AchLive
Substitution problem in HTML field was created by AchLive
Hi everyone, I have created an HTML field and inside it I would like to display the value of another date type field.
If I recall it as a raw field [cb_data_scadenza_corso_titolare_account] it returns me the value in the format 2022-01-19 and then I try to get the formatted value, which should return 19-01-2022, and I try with [cb:userfield field="cb_data_scadenza_corso_titolare_account"/] but in this case it does not return any value.
I have used this code [cb:userfield field="cb_data_scadenza_corso_titolare_account"/] in other situations, such as articles, AutoAction emails and it works perfectly, while in this HTML field it doesn't work
What am I doing wrong?
Thanks for the support

Please Log in to join the conversation.

1 week 4 days ago #331749 by krileon
Replied by krileon on topic Substitution problem in HTML field
userfield substitutions respect display permissions. So if the field is not set to display on profile then a userfield substitution won't display it. If the field isn't accessible to the viewing user then again userfield won't display it. Please also be sure to follow the exact syntax as shown in our documentation below.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

Looks like you're missing a space between the quote and end tag, but more than likely your issue is an access based one.

[cb:userfield field="FIELD_NAME" /]


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.

1 week 3 days ago #331760 by AchLive
Replied by AchLive on topic Substitution problem in HTML field
Thanks for the reply.
You're right, I realized that the field, although visible in the profile, is part of a Tab accessible only to SuperUser.
In this Tab I have inserted fields that only SuperUser should be able to modify but at the same time I would like to display their value in the HTML field that I have created in a different TAB and also accessible to Registered. It all works with the raw values.
At this point the only problem remains of the date fields which, if taken raw, are not displayed in the desired way dd/mm/yyyy.
Is there a way to take raw date data (yyyy/mm/dd) and then transform it into formatted data (dd/mm/yyyy)?
Or is there a way to make a Tab visible only to SuperUser leaving the access level Registered?
I need to create a Tab with fields editable only by SuperUser and then take their values ​​to show as formatted to the Registered user in the HTML field.
In the current condition I noticed that the same fields, inserted in an AutoAction - Email, work well and are displayed as formatted.
Thanks for the support

Please Log in to join the conversation.

6 days 10 hours ago #331776 by krileon
Replied by krileon on topic Substitution problem in HTML field
Does that tab need to be visible on profile to super users? If not move it to a not shown on profile position then use CB Privacy to make it editable by Super Users only followed by settings its tab access back to Public or Registered. This should give you the desired results. It's a lot more complicated if you also want it visible on profile, but only to super users.


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.

6 days 8 hours ago #331784 by AchLive
Replied by AchLive on topic Substitution problem in HTML field
Thanks for the reply.
I would need the card to be visible on the profile and on edit profile only by Super Users. If it can be done I couldn't find the way, I would be grateful if you could explain it to me

Please Log in to join the conversation.

6 days 8 hours ago #331786 by krileon
Replied by krileon on topic Substitution problem in HTML field
Ok, in that case you'll need an extra tab. First move the tab to a not shown on profile position. Next use CB Privacy and set the tab only editable by Super Users. Now set the tab to Public or Registered access. Next create a new empty tab set to Super Users. Now add a Custom HTML field to that tab (or multiple with 1 per field you want displayed) and substitute in your fields. This effectively separates the profile edit and profile view renderings of those fields so you've more control over them individually.


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.220 seconds

Facebook Twitter LinkedIn