Displaying the only the last 6 files of a category in article using Phoca Download Plugin

by kokbira   Last Updated August 01, 2020 13:10 PM

Phoca Download has a plugin to show a list of files in certain category using {phocadownload view=filelist|id=XX|limit=YY}, where XX is the number of category and YY is the number of files to show. For the particular case, I would like to show the last 6 files uploaded to certain category.

I would like to show certain categories to show on certain title ascendant ordering and other to show on certain title descendant ordering, but it is possible to use only one ordering on Phoca Download settings.

There is no parameter in Phoca Download Plugin documentation that let us change file ordering particularly on that view.

Do you know how so solve that?

Tags : phocagallery

Answers 1

Well, I found only a fix on code change.

  1. On plugins/content/phocadownload/phocadownload.php copy from case 'filelist': to break; and paste bellow changing filelist to filelistdt;
  2. Replace $fileOrdering = PhocaDownloadOrdering::getOrderingText($ordering, 3); on that case to $fileOrdering = 'a.title DESC';
  3. On Phoca Download Settings, use title ascendant for default ordering;
  4. On the use of Phoca Download Plugin, use {phocadownload view=filelist|id=XX|limit=YY} for title ascendant ordering or {phocadownload view=filelistdt|id=XX|limit=YY} for titls descendant ordering.
  5. For the last 6, use {phocadownload view=filelistdt|id=XX|limit=6}

The only issue I found with that is when Phoca Download Plugin would be updated, that changes will be overwritten :(

November 04, 2019 19:08 PM

Related Questions

Joomla error on Phoca Gallery

Updated July 13, 2016 08:04 AM