New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add relation controller as widget type in model form #169

Open
Alex360hd opened this Issue Aug 21, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@Alex360hd

Alex360hd commented Aug 21, 2017

Hello,

I followed this excellent tutorial : https://vimeo.com/123489421 to create a one to many relation using the relation controller element. It perfectly works.

But I wonder why the builder plugin don't allow to create that kind of relation directly in the UI. It already allow to create a simple relation (dropdown / checkboxes), or even the recordfinder element.

I think it would be too much difficule to add the relation controller to the list, as a new widget type or as a suboption of the recordfinder, basically you just have to fill the model you want to link, the number of records you want to show by default and the buttons you want to display in the toolbar (add|remove|create|etc...)

The builder plugin could easily create a generic partial by default to display the relation controller :

<?= $this->relationRender($model) ?> // where $model is the name of the model we defined in the widget options.

The only things we should do manually (as I know you don't want to touch php code too much) would be to add the relation controller to the $implement variable, and link the config_relation.yaml. A little like the reorder behavior.

What do you think about this ?

@LukeTowers

This comment has been minimized.

Show comment
Hide comment
@LukeTowers

LukeTowers Oct 26, 2017

Member

@Alex360hd this would be complicated to implement as at some point the user would have to manually edit something. Perhaps if we had an interface for adding the RelationController behavior to a controller (similar to FormController and ListController) then we could then also have a RelationController formwidget control (alias for partial that generates a .htm partial file in the model directory) defined as well that would use the defined relationcontroller information.

Member

LukeTowers commented Oct 26, 2017

@Alex360hd this would be complicated to implement as at some point the user would have to manually edit something. Perhaps if we had an interface for adding the RelationController behavior to a controller (similar to FormController and ListController) then we could then also have a RelationController formwidget control (alias for partial that generates a .htm partial file in the model directory) defined as well that would use the defined relationcontroller information.

@eXpl0it3r

This comment has been minimized.

Show comment
Hide comment
@eXpl0it3r

eXpl0it3r Nov 13, 2017

In the meantime would it be possible to make the list view's saving not fail if you've manually added a relation type and haven't picked a type?

eXpl0it3r commented Nov 13, 2017

In the meantime would it be possible to make the list view's saving not fail if you've manually added a relation type and haven't picked a type?

@Alex360hd

This comment has been minimized.

Show comment
Hide comment
@Alex360hd

Alex360hd Nov 14, 2017

+1 to this, it would be great to be able to fill custom text in that "type" column. Cause there are several plugins that add new types (I think about image resizer for example).

The best option would be to be aware of that additions and add the new types to the list, but another great and simpler options is to allow people to fill what they want into that type.

What about a kind of autocomplete field, but with the possibility to add something that is not to the autocomplete database.

Alex360hd commented Nov 14, 2017

+1 to this, it would be great to be able to fill custom text in that "type" column. Cause there are several plugins that add new types (I think about image resizer for example).

The best option would be to be aware of that additions and add the new types to the list, but another great and simpler options is to allow people to fill what they want into that type.

What about a kind of autocomplete field, but with the possibility to add something that is not to the autocomplete database.

@LukeTowers

This comment has been minimized.

Show comment
Hide comment
@LukeTowers

LukeTowers Nov 14, 2017

Member

@Alex360hd I'm always open to reviewing Pull Requests

Member

LukeTowers commented Nov 14, 2017

@Alex360hd I'm always open to reviewing Pull Requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment