How sort backend categories dropdown

Veritas
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 02 Feb 2018, 15:07

How sort backend categories dropdown

Post by Veritas » 16 May 2018, 11:58

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: 39981
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How sort backend categories dropdown

Post by Jan » 17 May 2018, 00:28

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 Newbie
Phoca Newbie
Posts: 5
Joined: 02 Feb 2018, 15:07

Re: How sort backend categories dropdown

Post by Veritas » 17 May 2018, 15:28

//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: 39981
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How sort backend categories dropdown

Post by Jan » 18 May 2018, 22:58

Ok, great to hear it.

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

Post Reply