-
AuthorPosts
-
friends1976 Friend
friends1976
- Join date:
- April 2008
- Posts:
- 27
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 4
- Thanked:
- 1 times in 1 posts
July 25, 2008 at 12:48 am #131314I would like the CategoriesList module to list the categories by the order I select rather than the ID joomla gives when creating them. Is there a way to do this? Thank you very much!
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
July 25, 2008 at 3:44 am #262145Hi
You can edit mod_ja_categorieslist.php(modulesmod_ja_categorieslist folder)
you will see those lines:
switch ( $ordering ) {
case 'alpha':
$order = 'a.name ASC';
break;case 'category':
case 'popular':
case 'newest':
case 'oldest':
default:
$order = 'a.name DESC';
}
$where = ($secid) ? "n AND a.section IN (".$secid.")" : "";$query = "SELECT a.id,a.title, a.description AS text, '' AS created,"
. " '2' AS browsernav,"
. " s.id AS secid, a.id AS catid,"
. " CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(':', a.id, a.alias) ELSE a.id END as slug"
. "n FROM #__categories AS a"
. "n INNER JOIN #__sections AS s ON s.id = a.section"
. "n LEFT JOIN #__menu AS m ON m.componentid = a.id"
. "n WHERE a.published = 1"
. "n AND s.published = 1"
. ' AND a.access <= '.(int) $user->get('aid')
. ' AND s.access <= '.(int) $user->get('aid')
. $where
. "n ORDER BY $order"
. "n LIMIT 0, $limit";
$db->setQuery( $query );$rows = $db->loadObjectList();
That is code get categories, Order by $order, you can change as you wantfriends1976 Friendfriends1976
- Join date:
- April 2008
- Posts:
- 27
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 4
- Thanked:
- 1 times in 1 posts
July 25, 2008 at 12:47 pm #262282I have no idea what to change the code to. I want it to order the categories by Order # not ID. Can you suggest the change? Thank you.
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
July 25, 2008 at 2:40 pm #262303Hi
you can change
$order = 'a.name DESC';
to
$order = 'a.ordering DESC';
friends1976 Friendfriends1976
- Join date:
- April 2008
- Posts:
- 27
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 4
- Thanked:
- 1 times in 1 posts
July 25, 2008 at 5:28 pm #262318I tried to change the code to the following:
switch ( $ordering ) {
case ‘alpha’:
$order = ‘a.ordering DESC’;
break;case ‘category’:
case ‘popular’:
case ‘newest’:
case ‘oldest’:
default:
$order = ‘a.ordering DESC’;but it didn’t work. This is how it looks in the admin…
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
July 25, 2008 at 5:48 pm #262321You can change like above but change DESC to ASC
friends1976 Friendfriends1976
- Join date:
- April 2008
- Posts:
- 27
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 4
- Thanked:
- 1 times in 1 posts
July 25, 2008 at 6:13 pm #262331You can tell I know sooo much about this! LOL!
Thank you, thank you, thank you!!! 😀
-
AuthorPosts
This topic contains 7 replies, has 2 voices, and was last updated by friends1976 16 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum