How to display subcategories with content plugin ?

Phoca Download - download manager
AlainR
Phoca Enthusiast
Phoca Enthusiast
Posts: 50
Joined: 24 Jul 2018, 16:33

How to display subcategories with content plugin ?

Post by AlainR »

Hi.
We need to display the 5 most downloaded files of all subcategories of a parent category. How to do this with the PhocaDownload content plugin?
We put the following tag

Code: Select all

{phocadownload view=filelist|id=9|limit=5|ordering=10|target=b}
but no files are displayed since the parent category does not contain (and will never contain) any files.

Another problem with this plugin is that options 13, 14, 15 and 16 of the ordering attribute do not work, an SQL error is displayed, count and average fields appear unknown:

Code: Select all

Unknown column 'r.count' in 'order clause'
Unknown column 'r.average' in 'order clause'
Thank you in advance for your help.
Best regards.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How to display subcategories with content plugin ?

Post by Jan »

Hi, there is no such option, so this needs to be customized.

For now - the files are displayed from selected category, to display it from parent categories and its subcategories - the recursive function needs to get ID from parent and find all subcategories, then all IDs (parent category, subcategories) need to be applied in SQL query (like instead of id = 10 ==> id IN (10,5,6,...)

Ordering: which component and plugin version do you use?

Jan
If you find Phoca extensions useful, please support the project
AlainR
Phoca Enthusiast
Phoca Enthusiast
Posts: 50
Joined: 24 Jul 2018, 16:33

Re: How to display subcategories with content plugin ?

Post by AlainR »

Thank you very much !
Very basically, I have already managed to modify the code to take into account several IDs entered manually.

For this project, I use :
* Composant 3.2.3
* Plug-in 3.2.1
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How to display subcategories with content plugin ?

Post by Jan »

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