This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Hey!, is there an option to make a RelationRender list in a backend controller "ReadOnly" , other than setting it in the config_relation.yaml ? I need to make the relation readOnly within the Preview version of my model ? Can I set a different config_relation.yaml for preview only?

thank you so much!

Create two partial fields, one for each context. update and preview, in the partial of preview, just pass the readOnly parameter in the render, example:

<?= $this->relationRender('addresses', ['readOnly' => true]); ?>

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.