Last active
March 24, 2022 14:29
-
-
Save cgi-caesar/ccb7be0f46b500eac10f02b0f5dc6004 to your computer and use it in GitHub Desktop.
aMember (site.php): Sort Items in Active Resources Widget Alphabetically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Am_Di::getInstance()->hook->add(Am_Event::BEFORE_RENDER, function (Am_Event $e) { | |
if (stripos($e->getTemplateName(), 'blocks/member-main-resources.phtml') !== false) { | |
usort($e->getView()->resources, function ($a, $b) {return strtolower($a->title) <=> strtolower($b->title);}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment