I made a modification to some of the k2 core files to add another ordering option for items in a category (order by category id). Ive made modifications to the following files to achieve this:
com_k2/models/itemlist.php on line 279 added
case 'catid':
$orderby = 'i.catid ASC';
break;
com_k2/views/itemslist/tmpl/category.xml on line 81 added
<option value="catid">Category</option>
com_k2/views/itemslist/tmpl/generic.xml on line 22 added
<option value="catid">Category</option>
The hacks i've made seem to work fine, but only if i change the params field in the jos_k2_categories table by hand in the database. Whenever i make changes to the category via the admin, the "item ordering" field reverts to "default". It seems to me that adding the option to xml files should make this option available, but i have limited knowledge of extension developement in Joomla. Is there some where else that add this new option to? How do i get the new ordering option i added to show up in the Joomla admin?