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

Tschallacka
Tschallacka

At this point you have to jump through a lot of "hoops" to get a management field for a relation working

https://octobercms.com/docs/backend/relations#has-many

  • You first have to make the config_relation.yaml in the controller.
  • Then in the controller add 'Backend.Behaviors.RelationController' to the implementations
  • In the model add the relation you want to define
  • List the editing fields in the behaviour yaml
  • Then make a partial in the controller that calls relationRender('relationname')
  • Then implement that partial in fields.yaml so it can be included in a tab

Would it be possible to add a feature for a field type:

fields:
    relationname: 
        type: advanced_relation

And that it defaults to the controller defined in the model, reads from that controller the fields and columns.yaml files and creates the management setup with create and update buttons default.

For people who want the really complicated setup with all the features they can still go the "long way around" but I would suspect many people would welcome this feature for the easy if implementation of other related forms in one form without having to swtich between forms.

Last updated

1-1 of 1

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