keyagency/taxonomy-terms-order
Composer 安装命令:
composer require keyagency/taxonomy-terms-order
包简介
Drag & drop reordering for Statamic taxonomy terms
README 文档
README
Drag & drop reordering for taxonomy terms in the Statamic Control Panel.
Statamic supports reordering entries in collections, but taxonomy terms are always sorted alphabetically. This addon adds a dedicated Terms Order page per taxonomy where you can drag terms into the desired order. After saving, the Control Panel terms listing follows that order automatically — and your frontend templates can too.
Features
- Drag & drop reordering of taxonomy terms, straight from the CP navigation
- Order is stored as a plain
orderfield in each term's YAML — no database, no magic - Sets
sort_by: orderon the taxonomy, so the native CP terms listing follows the manual order automatically - New terms are appended to the end of the list automatically
- Reset button to remove the manual order and go back to alphabetical sorting
- Dedicated
reorder {taxonomy} termspermission per taxonomy - Multisite-ready: order is shared across sites, titles stay localized
- Zero core overrides: built entirely on Statamic's public addon APIs
How to Install
Run the following command from your project root:
composer require keyagency/taxonomy-terms-order
How to Use
- Open the Control Panel. A Terms Order item appears in the Tools section of the navigation. It links to an overview of all orderable taxonomies (there's also a child link per taxonomy).
- Pick a taxonomy, drag the terms into the desired order and hit Save Order (or cmd+s).
- Done. The terms listing and your frontend now follow the manual order.
Changed your mind? Hit Reset on the taxonomy's order page to remove the manual order from all terms and go back to alphabetical sorting.
Limiting which taxonomies are orderable
By default every taxonomy can be reordered. To limit this, publish the config:
php artisan vendor:publish --tag=taxonomy-terms-order-config
// config/statamic/taxonomy-terms-order.php return [ 'taxonomies' => ['article_categories'], // or ['*'] for all ];
Permissions
Non-super users need the Reorder terms permission, which appears per taxonomy in the "Taxonomy Terms Order" permissions group. Users without this permission won't see the navigation item.
Frontend
The {{ taxonomy:* }} tag does not apply a default sort, so add the order_by parameter in your templates:
{{ taxonomy:article_categories order_by="order:asc|title:asc" }}
{{ title }}
{{ /taxonomy:article_categories }}
The title:asc fallback keeps taxonomies without a manual order sorted alphabetically, so the same partial works for both.
How it works
- Saving an order writes a sequential
orderkey into each term's YAML file (content/taxonomies/<taxonomy>/<slug>.yaml). - The taxonomy config gets
sort_by: orderandsort_dir: asc, which Statamic natively supports for sorting the CP terms listing. - A
TermSavinglistener assignsmax(order) + 1to terms created without an order, so they land at the bottom of the list.
Support
Found a bug or have a feature request? Open an issue or email development@keyagency.nl.
About Key Agency
Key Agency is a digital agency based in Amsterdam that helps brands grow with strategy, content, technology and advertising working together as one digital ecosystem.
- Website: keyagency.nl
- Contact: development@keyagency.nl
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-08