How to build Tags under Tailor

I am thinking to reducing the amount of plugins and remove Blog, BlogHub (Tags and Post Count) and Custom Fields plugins.

I followed the Tailor Blog Creation tutorial and had a go at creating Tags and so far I have written this

project/tag.yaml

handle: Project\Tag
type: structure
name: Tag
drafts: false

structure:
    maxDepth: 1

navigation:
    icon: icon-tags
    parent: Project\Post
    order: 10

fields:
    posts:
        type: relation
        relation: Project\Post
        label: Tag Post
        comment: 'Insert tag for the project post'
        nameFrom: title
        emptyOption: postsEmpty

project/post.yaml

fields:    
  tags:
          tab: Manage
          label: Tags
          mode: relation
          type: taglist
          nameFrom: slug
          permissions: tags

When I tried to create tag I faced this error

Model ‘Tailor\Models\EntryRecord’ does not contain a definition for ‘posts’.

Can anyone assist me to what this error mean and how to achieve building the tag within Tailor?

you can try this
project/tag.yaml

handle: Project\Tag
type: structure
name: Tag
drafts: false

structure:
    maxDepth: 1

navigation:
    icon: icon-tags
    parent: Project\Post
    order: 10

fields:
    posts:
        type: entries
        label: Tag Post
        comment: 'Insert tag for the project post'
        displayMode: taglist
        source: Project\Post

project/post.yaml

fields:
    tags:
          tab: Manage
          label: Tags
          type: entries
          displayMode: taglist
          source: Project\Tag

Entries - October CMS - 3.x

1 Like

Much appreciate jackhuynh0407 for the solution

1 Like