Labels |
Added:
No Code Attached Yet
|
I said there was no ordering at all in this module so not sute how you can say it is not working when it doesnt exist
Fixed. Just want point out that even if the option exist like in the Menu type: List All Categories in an Article Category Tree, is not working.
@brianteeman good catch
@carlitorweb if Brian (who is cofounder of J!) says that this does not exist, than its more like feature request
, so why dont you submit a PR that will introduce it?
@wojtekxtx it is a feature request
@brianteeman Good. So now let's wait for PR from @carlitorweb.
@wojtekxtx if you test it, I will do the PR for sure
Labels |
Added:
?
good first issue
|
You can modify the code to include an additional parameter for ordering, and then adjust the query used to retrieve the articles accordingly. This can be a example for adding a new parameter for ordering in the XML file that defines the module.
<field
name="ordering"
type="list"
label="Select Ordering"
default="ordering"
>
<option value="ordering">Default Ordering</option>
<option value="title">Title</option>
<option value="created">Date Created</option>
<option value="modified">Date Modified</option>
<option value="hits">Hits</option>
</field>
and In the PHP code, retrieve the value of the new ordering parameter and use it to adjust the query used to retrieve the articles:
$order = $params->get('ordering', 'ordering');
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->qn('id'))
->from($db->qn('#__content'))
->where($db->qn('catid') . ' = ' . (int)$idbase)
->order($db->qn($order));
$db->setQuery($query);
$articleIds = $db->loadColumn();
Finally modify the rest of the code to use the retrieved article IDs and apply the selected ordering:
$cacheparams->methodparams->set('ids', $articleIds);
$cacheparams->methodparams->set('filter_order', $order);
This sets the ids parameter to the retrieved article IDs and sets the filter_order parameter to the selected ordering. These parameters are then used to retrieve and display the articles.
I hope By making these modifications, you can add the ability to set ordering to this Joomla module. please give your point of view.
Hi @brianteeman
I have setup the project but the Extension "com_content" (Article) is missing on my setup so I am installing it again from "https://extensions.joomla.org/"
Please check that the marked extension in the attached screenshot is correct.
if it is missing from your setup then you have done something wrong in creating the site. it is not available anywhere to download on its own
Hi @brianteeman
I found the Article Component but its protected and I am unable to Enable this
Even I have checked below permissions for
i have solved this so can you please check this out?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-05-20 08:38:37 |
Closed_By | ⇒ | alikon | |
Labels |
Added:
Feature
Removed: ? |
Status | Closed | ⇒ | New |
Closed_Date | 2023-05-20 08:38:37 | ⇒ | |
Closed_By | alikon | ⇒ |
oops, misread
I got it
Can you make it clear exactly where in that page you want that feature?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-08-08 12:22:44 |
Closed_By | ⇒ | richard67 |
This may be opened again as the issue has not yet been resolved.
In fact this order is not working in the Menu type: List All Categories in an Article Category Tree do not work the Category Order option