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

Mik
Mik

Very simple question. How to display dropdown list in one model related to other model? If I have "Product" model for products and "Category" model for categories so I want to select category for each product throug dropdown list. Can somebody help me?

Mik
Mik

Great community

JeffGoldblum
JeffGoldblum

I know right?! We especially love sarcasm! :P

http://octobercms.com/docs/backend/forms#widget-relation is what you're looking for.

Mik
Mik

Ok, thank you for the answer. Could you provide some example please? I tried to do as it was written in docs but october throws exception. The main problem of october lies in the fact that there is no examples of useage at this moment.

Last updated

CianH
CianH

Sorry to resurrect a old post but i too am struggling with this. ive read the documentation but im still unclear how to use the Builder plugin to populate a dropdown with values from another table/model.

JeffGoldblum
JeffGoldblum

@cian19332 you can't use the Builder for that without being willing to dive into the code of your plugin and get your hands dirty a bit first. Read into database based relationships and then look into using either a simple FormWidget (either the Relation or the RecordFinder widgets); or look into using the advanced RelationController behavior.

1-6 of 6

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