https://github.com/ethercreative/w8
Sort entries by category and weight
https://github.com/ethercreative/w8
craft-plugin craftcms craftcms-plugin craftcommerce sorting sorting-algorithms wip
Last synced: 7 months ago
JSON representation
Sort entries by category and weight
- Host: GitHub
- URL: https://github.com/ethercreative/w8
- Owner: ethercreative
- License: mit
- Created: 2017-02-10T11:32:41.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-10T15:04:00.000Z (about 9 years ago)
- Last Synced: 2025-08-29T08:39:32.221Z (7 months ago)
- Topics: craft-plugin, craftcms, craftcms-plugin, craftcommerce, sorting, sorting-algorithms, wip
- Language: PHP
- Size: 4.88 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# W8
Sort entries and products by category and weight
**[WIP] Not production ready**
## Usage
```twig
{# Sort by element weight #}
{% set entries = craft.entries.section('news').order('w8') %}
{# or #}
{% set entries = craft.entries.section('news').order('w8|self') %}
{# Sort by category field #}
{% set entries = craft.entries.section('news').order('w8|categoryField') %}
{# Sort by multiple #}
{% set entries = craft.entries.section('news').order('w8|self|categoryField|otherCategoryField') %}
{# Sort by category field and specify max level/depth #}
{% set entries = craft.entries.section('news').order('w8|categoryField:2') %}
```