How sort backend categories dropdown

Phoca Download - download manager
Veritas
Phoca Member
Phoca Member
Posts: 13
Joined: 02 Feb 2018, 15:07

How sort backend categories dropdown

Post by Veritas »

Hello
in the Phoca Download backend I would need to sort alphabetically the dropdown of the categories because when I insert new categories these are in order of insertion.
Do I have to act on the code? Which file should I modify?
I attach a picture to make you understand what I need.

https://ibb.co/bUsTqd

Thank you and sorry for my bad English.

Marco

Tags:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How sort backend categories dropdown

Post by Jan »

Hi, see:
administrator\components\com_phocadownload\models\fields\phocadownloadcategory.php

This field displays select box with list of categories.

Jan
If you find Phoca extensions useful, please support the project
Veritas
Phoca Member
Phoca Member
Posts: 13
Joined: 02 Feb 2018, 15:07

Re: How sort backend categories dropdown

Post by Veritas »

//build the list of categories
$query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid'
. ' FROM #__phocadownload_categories AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.title';
//. ' ORDER BY a.ordering';

Problem solved, thanks Jan.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How sort backend categories dropdown

Post by Jan »

Ok, great to hear it.

Jan
If you find Phoca extensions useful, please support the project
Post Reply