codemonauts / craft-readonly-field

Read-only Field for Craft CMS
MIT License
8 stars 3 forks source link

Feature Request: allow the usage of existing fields #4

Closed jan-dh closed 2 years ago

jan-dh commented 4 years ago

It would be nice if you'd be able to use data from let's say globals etc. in the field.

For example: make a global instruction field that's editable by the user. Use that global in the readonly field (where instructions is the handle of the global ).

{{ instructions.fieldHandle }}

It makes the content a lot more managable.

kringkaste commented 4 years ago

Hi! Interesting feature request. But I'm not sure I got you right. Where/how do you want to enter the "Twig-style" template

{{ instructions.fieldHandle }}

into the field? Should this be possible in the field settings? As "unchangeable" predefined content or as default when empty? And when should it be rendered and the content be replaced? Whenever you save the entry or only the first time?

Could you give some more informations how the workflow should be?

jan-dh commented 4 years ago

I'm using the Read-only field at the moment to populate an instructions field for each type of matrix block in a Craft matrix field. Works fine, however I would like an "editor" to be able to edit those instructions without having access to the field settings.

I was thinking of making a couple of global fields, or maybe even a channel with instructions that I'd be able to link to the read-only field, so that the relation is set up in the fields section of the admin panel, but the actual content is maintainable from some place else.

I do realize that there would have to be some relationship defined somewhere so you can trigger the resaving of the matrix field whenever the content of the link channel or global is updated. Not really sure what the best way to go about this would be.

kringkaste commented 2 years ago

FYI: With the new release 2.0 we added the feature of Twig templates for output.