Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add map and sort_by Twig filters #273

Merged
merged 12 commits into from
Nov 30, 2015
Merged

Conversation

PhrozenByte
Copy link
Collaborator

This is intended as a additional last-minute feature for Pico 1.0.0. Feedback is highly appreciated!

Especially the sort_by filter is important to allow users custom sorting algorithms apart from renaming their content files. This also makes Step 4 of our Blogging section in the docs obsolete (it btw describes the problem a sort_by filter solves pretty well). Something like this is impossible to achieve with a Twig macro, so theme designers would otherwise very often need to also write a plugin. The map filter is just a by-product of the sort_by filter (better: of PicoTwigExtension::getKeyOfVar()).

What do you think?

@theshka
Copy link
Collaborator

theshka commented Nov 18, 2015

I like the proposed changes @PhrozenByte, it only adds functionality and thats great. 👍 Perhaps including an example in the cookbook section of the docs and replacing the blogging instructions to use the new filter?

PhrozenByte added a commit that referenced this pull request Nov 30, 2015
@PhrozenByte PhrozenByte merged commit 9a7e533 into master Nov 30, 2015
@PhrozenByte PhrozenByte deleted the feature/PicoTwigExtension branch November 30, 2015 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants