Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

Set a non-editable field if another field has a specific value

  • AchLive
  • AchLive
  • OFFLINE
  • Posts: 253
  • Thanks: 14
  • Karma: 3
7 years 10 months ago #292114 by AchLive
Please try on your test site

Fields interested firstname and lastname

On lastname fied I added this on Profile Edit Value Layout
Code:
[cb:if firstname!=""][cb:userfield field="_UE_YOUR_LNAME" /]<div class="hidden">[value]</div>[/cb:if] [cb:if firstname=""][value][/cb:if]

Please try and you will be able to verify that it does not work
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
7 years 10 months ago #292130 by krileon
The below will work fine for "Profile Edit Value Layout" layout for the lastname field. If a lastname is supplied it'll simply display that lastname. If it's not supplied it'll let you add one.

Code:
[cb:if lastname!=""][lastname]<div class="hidden">[value]</div>[/cb:if] [cb:if lastname=""][value][/cb:if]

You can not use formatted substitutions in the layouts as it can result in an infinite loop. At some point it may allow them after more detailed regexp parsing is added for them, but for now your option is raw output 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.

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

  • AchLive
  • AchLive
  • OFFLINE
  • Posts: 253
  • Thanks: 14
  • Karma: 3
7 years 10 months ago #292162 by AchLive

You can not use formatted substitutions in the layouts as it can result in an infinite loop. At some point it may allow them after more detailed regexp parsing is added for them, but for now your option is raw output only.


Indeed it is what I'm trying to explain from the beginning that formatted substitutions in the layouts does not work in edit view layout. I already knew that the raw output work fine, but I need a formatted replacement.

At some point it may allow them after more detailed regexp parsing is added for them

You mean you will be added later the possibility that serves to me to use formatted substitutions in the layouts?
Thank you

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
7 years 10 months ago #292182 by krileon

Indeed it is what I'm trying to explain from the beginning that formatted substitutions in the layouts does not work in edit view layout. I already knew that the raw output work fine, but I need a formatted replacement.

I apologize for the misunderstanding.

You mean you will be added later the possibility that serves to me to use formatted substitutions in the layouts?

Yes, at some point you maybe able to output the formatting values in the layout but for now you can't as it's too easy to get stuck in an infinite loop. We'll have to add regexp to likely check what the reason value is set to to avoid this. You can try adding it to a Custom HTML field then substituting in the Custom HTML field for the time being as that might work if you need this now.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum