ja news 2 order automatically new categories to be first on front page
Forums Joomla Templates Club JA Teline III JA Teline III v1 ja news 2 order automatically new categories to be first on front page
I don’t know if you figured it out and solved the problem but I kinda fixed it; as I had this problem also… I wanted every category that has the latest article to be first and so on….
I edited the query for the categories selection. The query is not perfect and if anyone has a better and more improved version of it in mind, please submit it here so I can use it too!
Anyway here’s the changes you have to make:
At the file: modules/mod_janews2/helper.php find the function named: loadCategories
In there change the query from:
[PHP]$query = “SELECT `id`, `title`, `description`, CASE WHEN CHAR_LENGTH(`alias`) THEN CONCAT_WS(“:”, `id`, `alias`) ELSE `id` END as `slug` FROM `#__categories` s WHERE published = 1 and section=” . ( int ) $sid . $where;[/PHP]
to:
[PHP]$query = “SELECT a.created, s.id, s.title, s.description, CASE WHEN CHAR_LENGTH(s.alias) THEN CONCAT_WS(“:”, s.id, s.alias) ELSE s.id END as slug FROM #__categories s, #__content a WHERE a.catid = s.id AND s.published = 1 and s.section=” . ( int ) $sid . $where;
$query .= ” ORDER BY a.created DESC”;[/PHP]
In my site this works partially, so the code needs some cleaning up which i don’t know yet how to do it…
Merry Xmas & a Happy new year to all!
1 user says Thank You to cre8 for this useful post
<em>@zorroh 155565 wrote:</em><blockquote>ok, i’ll try to talk with my friend who can me help with this..</blockquote>
Hi,
did you find any solution for this problem?
See this thread, got a fix that works for me.
http://www.joomlart.com/forums/topic/ja_news2-only-show-categories-with-new-articles/
1 user says Thank You to sjmorris for this useful post
This topic contains 20 replies, has 7 voices, and was last updated by zorroh 14 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum