Skip to content

Adds a Twig filter to sort entries by a specified field's value

Notifications You must be signed in to change notification settings

frontendbeast/craftcms-sortbyfield

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

sortByField for Craft CMS

Adds a "sortByField" Twig filter which sorts an array of entries by the specified field's value.

Installation

  1. Move the sortbyfield directory into your craft/plugins directory.
  2. Go to Settings > Plugins from your Craft control panel and enable the sortByField plugin.

Usage

{% for entry in craft.entries|sortByField('height') %}

The filter also accepts an optional direction parameter:

{% for entry in craft.entries|sortByField('weight', 'desc') %}

About

Adds a Twig filter to sort entries by a specified field's value

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%