I am trying to sort a hash of hashes of the form { 1 => { customer_class_id => 1, discount => "0.000", name => "None" }, 2 => etc. } by name alphabetically in template toolkit.
I currently have this:
[% FOREACH category_id IN category.keys.sort($category_id.name) %] [% IF category.$category_id.customer_class_id == class_id %] <option value="[% category_id %]">[% category.$category_id.nam +e %]</option> [% END %] [% END %]
Everything's displaying fine but it's not sorting correctly!
Any tips please?
In reply to Sort a hash of hashes by value in template toolkit by dariusj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |