Answer the question
In order to leave comments, you need to log in
Joomla how to get a list of category content?
Hello, I googled a lot on this topic, but I could only find this solution
$db =& JFactory::getDBO();
$query = $db->getQuery(true);
$query = 'SELECT id FROM `#__categories` where parent_id=12';
$db->setQuery($query);
$res= $db->loadAssocList();
$idList=array();
foreach($res as $resOne){
$idList[]=$resOne['id'];
}
$idList = implode(",", $idList);
$query = 'SELECT * FROM `#__content` WHERE `catid` in (12, '.$idList.') AND `state`>0 LIMIT 0,50';
$db->setQuery($query);
$res= $db->loadObjectList();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question