Sort category contents by name default tip
authorDan Fuhry <dan@enanocms.org>
Fri, 12 Oct 2012 23:11:07 -0400
changeset 5 b9e0209fff68
parent 4 d5b2e522396d
Sort category contents by name
plugins/CategoryList.php
--- a/plugins/CategoryList.php	Sat Jul 31 01:03:14 2010 -0400
+++ b/plugins/CategoryList.php	Fri Oct 12 23:11:07 2012 -0400
@@ -65,7 +65,7 @@
                       . "  LEFT JOIN " . table_prefix . "pages AS p\n"
                       . "    ON ( p.urlname = c.page_id AND p.namespace = c.namespace )\n"
                       . "  WHERE c.category_id = '$cat_id'\n"
-                      . "  ORDER BY is_subcategory DESC;");
+                      . "  ORDER BY is_subcategory DESC, p.name ASC;");
   }
   else
   {
@@ -87,7 +87,7 @@
                       . "  LEFT JOIN " . table_prefix . "pages AS p\n"
                       . "    ON ( p.urlname = c.page_id AND p.namespace = c.namespace )\n"
                       . "  WHERE c.category_id = '$cat_id' AND $where\n"
-                      . "  ORDER BY is_subcategory DESC;");
+                      . "  ORDER BY is_subcategory DESC, p.name ASC;");
   }
   if ( !$q )
     $db->_die();