I use the "getChunks TV" script, btw.
When I use the Resources link to view the chunks, they are sorted in alphabetical order. Yet when I look at the list of them to add as "TV chunks", it’s in the order I created them in.
Not a big deal to me, but it makes me wonder why it does that. Maybe it’s due to the getChunks script?
You need to add "order by name" to the end of the sql sentence that is in getChunk snippet
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Could you tell me what the code I should add in? I know little to nothing about MySQL coding (although I know more on a phpMyAdmin-side of things).
try
<?php
$q_chunks = $modx->db->query('
SELECT
chunk.*
FROM modx_site_htmlsnippets AS chunk
INNER JOIN modx_categories AS category
ON chunk.category = category.id
WHERE
category.category IN ("'.$category.'")
ORDER BY
name
');
$ar_chunks = array();
while ($row = $modx->db->getRow($q_chunks)) {
$ar_chunks[] = $row['name'];
}
$l_chunks = implode("||",$ar_chunks);
return $l_chunks;
?>
"He can have a lollipop any time he wants to. That's what it means to be a programmer."