We have a requirement to have certain fields in a content item (when in the content editor) become visible when the editor checks a specific checkbox field (as these fields are only applicable to the content item if it has its “premium” field set).
So basically, when an editor/admin uses content explorer to create a new content item there would be a block of fields that are hidden until the “premium” checkbox is checked.
I have had a look at the visibility settings, but this appears to work when the content editor is rendered, rather than as the form is filled in, is this correct?
Is there any way of doing this? or will we need to make changes to the actual*content editor files to contain some javascript/ajax to show and hide fields? - in which case is it even possible to make changes the content editor? I’ve not been able to find reference to this in the “Customizing Active Assembly & Content Explorer Interfaces” 6.6 doc.
This implementation would require changes to system files, which would be overwritten on upgrade. We generally recommend against such implementations, and the documentation specifically warns against them.
I think the way that we will try to handle this is by setting either a readonly/visibility rule based on the value of the checkbox and once the user hits “update” reveal the new fields.
The only thing with this is that while it is possible to create a conditional rule that uses type: “Content Item Data” and the Value “Local/premium” and then set the operand to “=” and the value to that of the checked premium field (in this case 1)
The resulting rule would be:
Conditional: premium = 1
Though when trying to edit/add a content item using the content editor of a content type that has this rule the following error occurs:
com.percussion.error.PSEvaluationException: contentid may not be null