Feature No Code Attached Yet good first issue
avatar brianteeman
brianteeman
1 Jan 2023

Is your feature request related to a problem? Please describe.

The module displays a list of categories but there is no option to set the ordering.

image

Describe the solution you'd like

Just like everywhere else I would like to be able to set ordering

image

Additional context

avatar brianteeman brianteeman - open - 1 Jan 2023
avatar joomla-cms-bot joomla-cms-bot - change - 1 Jan 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Jan 2023
avatar carlitorweb
carlitorweb - comment - 3 Jan 2023

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

avatar brianteeman
brianteeman - comment - 3 Jan 2023

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

avatar carlitorweb
carlitorweb - comment - 3 Jan 2023

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.

avatar wojtekxtx
wojtekxtx - comment - 6 Jan 2023

@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?

avatar brianteeman
brianteeman - comment - 6 Jan 2023

@wojtekxtx it is a feature request
image

avatar wojtekxtx
wojtekxtx - comment - 6 Jan 2023

@brianteeman Good. So now let's wait for PR from @carlitorweb. ?

avatar carlitorweb
carlitorweb - comment - 6 Jan 2023

@wojtekxtx if you test it, I will do the PR for sure ?

avatar chmst chmst - change - 23 Feb 2023
Labels Added: ? good first issue
avatar chmst chmst - labeled - 23 Feb 2023
avatar chmst chmst - labeled - 23 Feb 2023
avatar arpan-mondal
arpan-mondal - comment - 13 Mar 2023

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>

avatar arpan-mondal
arpan-mondal - comment - 13 Mar 2023

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.

avatar nyni123
nyni123 - comment - 4 Apr 2023

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/"

image

Please check that the marked extension in the attached screenshot is correct.

avatar brianteeman
brianteeman - comment - 4 Apr 2023

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

avatar nyni123
nyni123 - comment - 4 Apr 2023

Hi @brianteeman
I found the Article Component but its protected and I am unable to Enable this

image

Even I have checked below permissions for

  1. User permissions
  2. Article permissions
avatar nawarajshah
nawarajshah - comment - 20 May 2023

i have solved this so can you please check this out?

avatar alikon alikon - change - 20 May 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-05-20 08:38:37
Closed_By alikon
Labels Added: Feature
Removed: ?
avatar alikon alikon - close - 20 May 2023
avatar alikon
alikon - comment - 20 May 2023

please test #40631

avatar brianteeman
brianteeman - comment - 20 May 2023

#40631 has absolutely nothing to do with this!! Please re-open

avatar alikon alikon - change - 20 May 2023
Status Closed New
Closed_Date 2023-05-20 08:38:37
Closed_By alikon
avatar alikon alikon - reopen - 20 May 2023
avatar alikon
alikon - comment - 20 May 2023

oops, misread

avatar nawarajshah
nawarajshah - comment - 20 May 2023

#40631 has absolutely nothing to do with this!! Please re-open

is my solution wrong?

avatar nawarajshah
nawarajshah - comment - 20 May 2023

I got it

avatar nawarajshah
nawarajshah - comment - 20 May 2023

Can you make it clear exactly where in that page you want that feature?

avatar richard67 richard67 - change - 8 Aug 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-08-08 12:22:44
Closed_By richard67
avatar richard67 richard67 - close - 8 Aug 2023
avatar richard67
richard67 - comment - 8 Aug 2023

Closing as having a pull request. Please test #41336 . Thanks in advance.

avatar charvimehradu
charvimehradu - comment - 19 Sep 2023

This may be opened again as the issue has not yet been resolved.

Add a Comment

Login with GitHub to post a comment