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

JeroenvanRensen
JeroenvanRensen

Hi everyone,

I'm new to OctoberCMS, and I'm trying to create a website with it. I made a page where the admin user can add, edit and delete clothing types. For example: dresses, jacks, tops, etc. Every type has one or multiple subtypes. By dresses they are short dresses, medium dresses, long dresses and party dresses.

Is there a simple way in October to make this user (admin)-friendly and easy-to-use?

Thank you! Jeroen

mjauvin
mjauvin

I would probably use a sub-type relation in your type model:
(ref. https://octobercms.com/docs/database/relations#one-to-many)

$hasMany['sub-type'] = <sub-type class here>;

And in your sub-type class:

$belongsTo['type'] = <type class here>;

If a sub-type can belong to more than one type, I would instead use $belongsToMany relation in both models.
(ref. https://octobercms.com/docs/database/relations#many-to-many)

1-2 of 2

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