-
AuthorPosts
-
pferrol Friend
pferrol
- Join date:
- September 2014
- Posts:
- 59
- Downloads:
- 41
- Uploads:
- 4
- Thanks:
- 6
- Thanked:
- 2 times in 1 posts
September 19, 2009 at 7:52 am #144371In frontpage i need view all catgories for secction, i can select all by de usertool but i need this by default, is posible??
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
October 27, 2009 at 2:19 am #321675Open modules/ja_news2/helper.php file, find following code:
function loadCategories($sid) {
$categories = array ();
$catids = $this->getUserSetting ( $sid, 'categories' );$where = '';
$limit = 0;
if ($catids) {
if (is_array ( $catids ))
$where .= " AND `id` in (" . implode ( ',', $catids ) . ")";
} else {
if (is_array ( $this->getUserSetting ( $sid ) ))
$where = " AND 0";
else
$limit = ( int ) $this->get ( 'cols', 2 );
}$db = & JFactory::getDBO ();
$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;
$db->setQuery ( $query, 0, $limit );
$rows = $db->loadObjectList ( 'id' );
foreach ( $rows as $cid => $row ) {
$obj = new stdclass ( );
$obj->category = $row;
$categories [] = $obj;
}
return $categories;
}
and change to:
function loadCategories($sid) {
$categories = array ();
$catids = $this->getUserSetting ( $sid, 'categories' );$where = '';
$limit = 0;
if ($catids) {
if (is_array ( $catids ))
$where .= " AND `id` in (" . implode ( ',', $catids ) . ")";
} else {
if (is_array ( $this->getUserSetting ( $sid ) ))
$where = " AND 0";
else
$limit = ( int ) $this->get ( 'cols', 2 );
}$db = & JFactory::getDBO ();
$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;
$db->setQuery ( $query );
$rows = $db->loadObjectList ( 'id' );
foreach ( $rows as $cid => $row ) {
$obj = new stdclass ( );
$obj->category = $row;
$categories [] = $obj;
}
return $categories;
}
1 user says Thank You to JA Developer for this useful post
November 14, 2009 at 12:32 pm #323553Great that I can increase the number of categories showing under each ja_news2 section.
Question: Can I choose to show all categories for only some sections or do I have to have the code change apply to all?
i.e. – I want:
SECTION 1
category 1 category 2 category 3SECTION 2
category 1 category 2 category 3
category 4 category 5 category 6SECTION 3
category 1 category 2 category 3Thanks.
sjmorris Friendsjmorris
- Join date:
- March 2009
- Posts:
- 22
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 5
- Thanked:
- 2 times in 1 posts
November 16, 2009 at 6:07 pm #323805I would love to do this as well. Thoughts?
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
November 17, 2009 at 9:30 am #323941Hi sjmorris
This module does not support your idea. I am sorry for not being of much help in the case.
February 3, 2010 at 5:11 pm #331436Very good. It works.
July 16, 2010 at 3:27 am #350038Well this works. It shows all categories in a section by default. Thanks for that.
Now I need another help, just little expansion of the code above, I think. 😀
In my section I have the following categories.
1,2,3,4,5,6,7,8,9I would like to only show my choice of categories for eg. 1,3,4,7,8 etc…
How would this possible?I found another good solution here, but it doesn’t solve the way I want yet.
http://www.joomlart.com/forums/topic/ja-news-2-multiple-rows/Thanks
PS. I’m using JA News II 1.0.1
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
July 27, 2010 at 1:36 am #350789ok, pls make done with my solution in there http://www.joomlart.com/forums/topic/ja-news-2-multiple-rows/
2) and then you try to re-sort order of categories with your expeclty order . 1,3,4,7,8 etc…
GOodluck
-
AuthorPosts
This topic contains 8 replies, has 7 voices, and was last updated by Saguaros 14 years, 5 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum