> For the complete documentation index, see [llms.txt](https://playground.e107sk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://playground.e107sk.com/plugin-dev-quick-notes/admin-ui/special-field-count-of-related-records.md).

# Special field - count of related records

Admin UI field:

`'chapter_page_count' => array('title'=> 'CUSLAN_87', 'type' => 'number', 'data'=>false, 'width' => '5%', 'readonly'=>TRUE, 'thclass'=>'center', 'class'=>'page-count center'),`

Note:  `'data'=>false,`  and `'readonly'=>TRUE,`  in definition\
\
It works because of this:

```
(SELECT COUNT(*) FROM `#page` p WHERE p.page_chapter = a.chapter_id) AS chapter_page_count 
```

It is not implemented correctly in edit mode. Still editable, only not saved. So for now, this is not a solution for only informative fields.
