Embed PageList w/Custom Sort
Permalink
I have created custom attributes for is_featured(checkbox) and featured_order(text, will be a number 1-6). How can I embed a PageList into a theme file that will show the is_featured pages listed in the featured_order order?
Any Ideas?
You can sort the array by inserting this line
after
then you need to define your sorting function at the bottom of the page like
usort ($cArray,"myCmp");
after
if (count($cArray) > 0) {
then you need to define your sorting function at the bottom of the page like
function myCmp($a,$b) { $fo_a = $a->getCollectionAttributeValue('featured_order'); $fo_b = $b->getCollectionAttributeValue('featured_order'); return strcasecmp($fo_a, $fo_b); }
All I need now is to somehow sort by:
before running though the custom template.
Any ideas?