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

maxDubovsky
maxDubovsky

Trying to use morphToMany relation for the tag cloud and tag search functionality.

public $morphToMany  = [
    'tags' => ['Max\Mem\Models\Tag', 'table' => 'max_mem_taggables', 'name'=>'taggable'],
];

I come with an issue that it is not possible to use relation_config.yaml and define views and toolbarButtons. This relation can be defined:

tags:
        label: Tags
        type: relation
        path: field_tags
        tab: Main info

And is rendered as a checkbox list. It is fine for me, but I will have 5k or more keywords and using checkbox list even with scrollbar is a hassle, so I need at least to create a search with autocomplete somehow there.

Are there any better ideas ?

Last updated

maxDubovsky
maxDubovsky

Solution: I use formwidget for making a special form-field with modified autocomplete search and post my own tags array to model's Save method.

1-2 of 2

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