We're using Jakoweb / AlanPich Modx Extra Glossary. It generates a nice front end page with A, B, C ... navigation which then link to a bunch of Glossary terms and explanations beginning with that letter. Only thing is, under each letter the terms are themselves not in alphabetical order, e.g:
C
Crocodile
Cat
Camel
Crayfish
We want
C
Camel
Cat
Crayfish
Crocodile
The terms per letter are all output to an [[+items]] placeholder. This seems to be set using the content of a $termsHTML variable:
[// Output all terms (grouped)
$groupsHTML = '';
foreach ($letters as $letter => $terms) {
$termsHTML = '';
if (count($terms)) {
// Prepare Terms HTML
foreach ($terms as $term) {
$params = array_merge($term, array(
'anchor' => strtolower(str_replace(' ', '-', $term['term'])),
'letter' => $letter
));
$termsHTML .= $modx->getChunk($termTpl, $params);
};
// Prepare letter wrapper HTML
$groupsHTML .= $modx->getChunk($groupTpl, array(
'items' => $termsHTML,
'letter' => $letter
));
};
};
The actual page within the manager IS output alphabetically. Would anyone have any idea how to sort the $termsHTML? Tried KSort but that didn't work.
[ed. note: lancipoos last edited this post 5 years, 6 months ago.]