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

Adam
Adam

I'm showing a hasMany partial but need to configure what is shown. It seems that the default options for hasMany (showing a management popup when clicking, showing delete button, showing checkboxes) can't be overwritten using the documented available options (https://github.com/octobercms/docs/blob/master/backend-relations.md#configuring-the-relation-behavior).

Is it possible to show a list from a hasMany relationship and remove the delete button (by using a custom toolBarbuttons partial file, set the text on the create button, remove checkboxes and overwrite the link?

Seems strange to have these options but not be able to use them? Unless I'm doing something spectacularly wrong.

In below example the search is showing, but the custom toolbar partial isn't showing, url isn't working and checkboxes are showing.

label: Offers
list: @/plugins/foo/bar/models/offer/columns_for_property.yaml
form: @/plugins/foo/bar/models/offer/fields.yaml
view:
  recordUrl: /foo/bar/offers/update/:id
  toolbarButtons: @/plugins/foo/bar/controller/offer/_relation_toolbar.htm
  showSearch: true
  showCheckboxes: false

Last updated

daftspunky
daftspunky

What Build are you on? These features will only work with Build 170+ I'm pretty sure

Adam
Adam

Ah ha that might be it then. Will duplicate and update build.

Thanks!

chad
chad

Is the hasMany relationship working? I want to show a list of the related items in my form. My primary form.yaml has a field with type: relationship but I get the following error:

The partial '/www/modules/backend/Widgets/form/partials/_field_relationship.htm' is not found. I'm running build 183 of Octobercms

cydrick.nonog
cydrick.nonog

we use the type relation not relationship.

Asinox
Asinox

chad said:

Is the hasMany relationship working? I want to show a list of the related items in my form. My primary form.yaml has a field with type: relationship but I get the following error:

The partial '/www/modules/backend/Widgets/form/partials/_field_relationship.htm' is not found. I'm running build 183 of Octobercms

Any idea how to fix this?

Thank you

cydrick.nonog
cydrick.nonog

Use relation instead of relationship

1-7 of 7

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