Homepage
Main navigation
Main content
Additional information
October Tricks
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
October CMS resources and help articles
Simple and to the point. Optimized by the community.
×
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
Edit trick
Changes will be published after manual review
Title
Give your trick a describing title. Do
not
start with «How to...».
Your trick
Keep it short and concise! Markdown is supported.
Given you have a model that uses a `count` property on a relationship to get only the related model count: ```php public $hasOne = [ 'comments_count' => [Comment::class, 'count' => true], ]; ``` To display this count value in a List, use the `useRelationCount` option in your `columns.yaml`. Using the usual `select: count` method would result in a `Unknown column 'count' in 'field list'` error. ```yaml comments_count: label: Number of related comments type: number relation: comments_count useRelationCount: true # this is important ```
References
Add additional online resources to your trick
×
Name
URL
×
Name
URL
+ Add reference
Topics
If your trick fits more than one topic select multiple. Select at least one.
Backend
Plugin Development
CMS
Twig
Themes
Deployment
Tags
You can use existing tags or create new ones. Add at least one.
Submit for review
Cancel
We use cookies to measure the performance of this website. Do you want to accept these cookies?
Accept
Decline