Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1621

Joomla! 5.x Coding • Re: Displaying a list of materials in a list of categories

$
0
0

Code:

use Joomla\CMS\Factory;$db = Factory::getContainer()->get('DatabaseDriver');$query = $db->getQuery(true);$id_cats = array_column($this->items[$this->parent->id], 'id');$query->select($db->quoteName(['id', 'title', 'catid']));$query->from($db->quoteName('#__content'));$query->where($db->quoteName('catid') . ' in (' .implode(",", $id_cats). ')');$query->where($db->quoteName('access') . ' = 1');$query->where($db->quoteName('state') . ' = 1');$query->order($db->quoteName('ordering') . ' ASC');$db->setQuery($query);$ResQU = $db->loadAssocList();
I did it like this :)

Statistics: Posted by eLig — Sat Sep 28, 2024 9:34 pm



Viewing all articles
Browse latest Browse all 1621

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>