Project

General

Profile

Feature #99384

Updated by Sybille Peters almost 2 years ago

In TCA it is possible to make forms disappear based on some conditions (displayCond). The conditions can be based bases on the state of other fields. 

 For this to work, you have to add a "reload" to the field it depends on so that the form will be saved and reloaded.  

 Suggested alternative would be to do this behaviour in JavaScript in the core so the form is dynamically displayed. I assume this is not easily done. 

 h2. Example use case 

 Imagine the following 

 Select list or checkbox with several available options: 

 Show 

 - Name 
 - Avatar 
 - Email 
 - Courses 
 - Publications 
 - Thesis topics 
 - ... 

 For some of these options, additional configuration is available. Now you have these options: 

 1. use displayCond and reload for the "Show" field. Which means a dialog will appear on every change asking if we should continue, even for the selections where it is not relevant 
 2. Just show all the fields which clutters the user interface with unused options. Not good 
 3. Write the code yourself in JavaScript which is extra work and makes the extensions very difficult to maintain. For example if you change the field type you have to adapt the JavaScript code.  

 I have used 3 now in one use case where 1 and 2 is not feasible. To make this more generic would be quite difficult, but I think not impossible. So the displayCond would be done via JavaScript in the core.  

Back