Replies: 7 comments
-
Good point, what about adding a property in the @MikeAlhayek do you have a better idea |
Beta Was this translation helpful? Give feedback.
-
@giannik
Then in the display driver on updating, you can securely set the secret for the role. |
Beta Was this translation helpful? Give feedback.
-
He doesn't want to show the field nor updating its value while updating (when using placement) |
Beta Was this translation helpful? Give feedback.
-
@hishamco |
Beta Was this translation helpful? Give feedback.
-
Got it, can we move this to discussion, I think the answer credit should goes to Mike :) |
Beta Was this translation helpful? Give feedback.
-
the secret field is just an example. |
Beta Was this translation helpful? Give feedback.
-
There are cases when you are creating or editing a content item that you do not want to render specific fields or parts in the admin.
For example, I have some secret fields in my content type and I've created various alternate templates for specific roles so that these secret fields are not rendered.
You can also achieve the same thing with placement rules that do not render fields or parts based on custom logic.
The problem is that when update is performed for the content item the field is still updated even though it is not rendered, overriding the existing values in the secret fields.
One approach to solve this is to add for all fields and parts an IsRendered property like a flag on the viewmodel to avoid the update call in the driver:
example code for textfield :
While this works it requires changing the code for every field and part.
I'm wondering if there may be a better approach
If the community is willing I can submit a PR with this suggestion for all the known contentfields and parts
Beta Was this translation helpful? Give feedback.
All reactions