-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
withSort not working for pages collection #50
Comments
Try putting quotes around the field... <ul>
{{#withSort pages "data.date"}}
<li>{{data.title}}</li>
{{/withSort}}
</ul> If this works, the docs should be updated. |
That seems to work, thanks for that, much appreciated! |
created a new issue to update docs, since this is resolve I'll go ahead and close it |
This works fine, but just sort by string, if you compare [1,2,10] output will be 1, 10, 2, If you need to make an index, try something like a-001, a-002. |
@dvera123 thanks, good to know. |
Is there any way to do a desc sort on pages, without having to explicitly declare the collection in the Gruntfile? E.g. It would be great if you could declare |
closing, we can continue discussion on handlebars-helpers repo |
I tried these options to no avail..
Help? |
@mattdwen @MayhemChaos I know it's been a while, but I suppose for people in the future who have arrived here like me... Handlebars helpers can take extra arguments (specified by name) after the default ones are provided. For more info on that, search for The
Here is the code that does it: |
Refer to my 'Tip: Using the #withSort option for creating navigation menu |
@webercoder Great! |
The final section here talks about sorting the pages collection:
If I add that code to a page within the boilerplate-bootstrap project, for example, the build fails with
This will build
But the output is not sorted.
Am I missing something, should this work?
The text was updated successfully, but these errors were encountered: