Page 1 of 1

How to display subcategories with content plugin ?

Posted: 03 May 2021, 10:25
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.

Re: How to display subcategories with content plugin ?

Posted: 07 May 2021, 13:10
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

Re: How to display subcategories with content plugin ?

Posted: 07 May 2021, 17:43
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

Re: How to display subcategories with content plugin ?

Posted: 12 May 2021, 16:23
by Jan
OK