Z
Z
zahar_922018-03-05 20:34:29
Joomla
zahar_92, 2018-03-05 20:34:29

How to sort Joomla content output by ID?

People, please tell me how to rewrite the output of the module so that the materials are sorted by category ID?
Here is the output code

<?php for ($i = 0, $n = count($list); $i < $n; $i ++) : ?>
<?php $item = $list[$i]; ?>
<div class="item">
<?php require JModuleHelper::getLayoutPath('mod_articles_news', '_item'); ?>

<?php if ($n > 1 && (($i < $n - 1) || $params->get('showLastSeparator'))) : ?>
<span class="article-separator"> </span>
<?php endif; ?>
</div>
<?php endfor; ?>

This variable contains the category ID.
$item->catid
You need to build the output in ascending order of category IDs. Google says to use the Array() function, but I don't have enough knowledge!((

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question