Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

[SOLVED] Display field value label in substitution

  • sirweb
  • sirweb
  • OFFLINE
  • Posts: 226
  • Thanks: 25
  • Karma: 2
6 years 8 months ago - 6 years 8 months ago #302836 by sirweb
Trying to display a field value label instead of the actual value, but I don´t get it.

Have read the tutorial here:
www.joomlapolis.com/documentation/18353-using-substitutions-throughout-cb

Example:
Select field cb_city with values and labels like
01 London
02 Paris ...and so on

Using [cb_city] of cause shows value, ie '01'
How do I make the substitution show label 'London' instead?
Last edit: 6 years 8 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 8 months ago #302849 by krileon
Replied by krileon on topic Display field value label in substitution
[FIELD_NAME] substitutions are raw values. You need the HTML value which you can output with [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.
The following user(s) said Thank You: sirweb

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

  • sirweb
  • sirweb
  • OFFLINE
  • Posts: 226
  • Thanks: 25
  • Karma: 2
6 years 8 months ago - 6 years 8 months ago #302858 by sirweb
Replied by sirweb on topic Display field value label in substitution
Aah, I knew it would be easy. Thank you! :)

Edit:
As HTML output, I get some access issues.
The 2 fields are placed in a tab with higher access level.
This is the content of a Custom HTML field in a tab with Registered access level:

<p>[cb:userfield field="cb_field1" /]</p>
<p>[cb_field1]</p>
<p>[cb_field2]</p>

As Profile owner (Registered), I can see row 2 and 3.
As Super User, I can see all 3 rows.

Why are raw values displayed, but not the HTML value?
What can I do to overcome it and view the HTML value too?
(The reason is that profile owner is only allowed to view, only moderators allowed to edit in frontend)
Last edit: 6 years 8 months ago by sirweb.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 8 months ago #302905 by krileon
Replied by krileon on topic Display field value label in substitution
HTML output respects access permissions. There isn't an HTML output usage that ignores access. Raw output will always ignore access. Move the field to a tab in a not shown on profile position then set the field to display on profile and don't adjust its profile view access. It should then substitute in fine and you can control its view access wherever you're substituting it in either by using IF statements with view access level or usergroup usage or adjusting access of the field you're substituting it into.


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

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

  • sirweb
  • sirweb
  • OFFLINE
  • Posts: 226
  • Thanks: 25
  • Karma: 2
6 years 8 months ago #302952 by sirweb
Replied by sirweb on topic Display field value label in substitution

krileon wrote: HTML output respects access permissions. There isn't an HTML output usage that ignores access. Raw output will always ignore access. Move the field to a tab in a not shown on profile position then set the field to display on profile and don't adjust its profile view access. It should then substitute in fine and you can control its view access wherever you're substituting it in either by using IF statements with view access level or usergroup usage or adjusting access of the field you're substituting it into.


Do you mean to use Tab position 'Not displayed on profile 1-9'?
What is the difference between those 9?
I tried 'Not displayed on profile 1' but the tab is visible for both user and moderator in edit mode which is not desired.
I guess the easiest solution will be to place the field where I want it shown and limit edit access instead.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 8 months ago #302966 by krileon
Replied by krileon on topic Display field value label in substitution

Do you mean to use Tab position 'Not displayed on profile 1-9'?

Yes.

What is the difference between those 9?

Organization and for substitutions since you can substitute in tabs by position.

I tried 'Not displayed on profile 1' but the tab is visible for both user and moderator in edit mode which is not desired.

Use CB Privacy to make the tab moderator edit only.

I guess the easiest solution will be to place the field where I want it shown and limit edit access instead.

If you want the field visible to everyone, but editable to moderators then I recommend using CB Privacy to force the tab or the fields to moderator edit only.


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

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

Moderators: beatnantkrileon
Powered by Kunena Forum