Page 1 of 1

PDL File Sorting Issues

Posted: 16 Sep 2015, 16:48
by tapiochre
Hi Jan

Using PDL 3.0.6 on Joomla 3.4.4

We have found a requirement to have two separate menu items that access (many dozens) of files each, where each menu accesses a different category of files.

In Menu option 1 we need the files sorted A-Z by Title
In Menu option 2 we need the files sorted by Date Descending

We can't find a way to do this as the Global setting cannot be overridden at the menu level.

Am I missing something? Is there a way to do this? I think it used to be possible in the PDL versions for J1.5 for example but that method has been removed.

Can you help?

Chris

Re: PDL File Sorting Issues

Posted: 17 Sep 2015, 23:18
by Jan
Hi, try to see:
https://www.phoca.cz/documents/16-joomla ... a-25-17-16
Jan

You can try to add the XML parameter to frontend view so every menu can get own ordering.

Jan

Re: PDL File Sorting Issues

Posted: 17 Sep 2015, 23:55
by tapiochre
EXCELLENT! This works!

How to add file ordering at the menu level in Phoca Download on Joomla 3.x (with PDL 3.0.6):

1. Go to your_webroot/components/com_phocadownload/views/category/tmpl
2. Backup the file default.xml
3. Edit default.xml
4. Look for:

Code: Select all

<field name="show_pagination_limit" type="radio" default="1" label="COM_PHOCADOWNLOAD_FIELD_SHOW_PAGINATION_LIMIT_LABEL" description="COM_PHOCADOWNLOAD_FIELD_SHOW_PAGINATION_LIMIT_DESC">
<option value="0">COM_PHOCADOWNLOAD_HIDE</option>
<option value="1">COM_PHOCADOWNLOAD_DISPLAY</option>
</field>
5. After that code, paste this code:

Code: Select all

<field name="file_ordering" type="list" default="1" label="File Ordering" description="File Ordering DESC">
			<option value="1">Ordering ASC</option>
			<option value="2">Ordering DESC</option>
			<option value="3">Title ASC</option>
			<option value="4">Title DESC</option>
			<option value="5">Date ASC</option>
			<option value="6">Date DESC</option>
			<option value="7">Id ASC</option>
			<option value="8">Id DESC</option>
</field>
6. Save the file.

Now, when you create a new menu (or edit an existing menu) associated with a Phoca Download Category, you will see, under the "Options" tab settings, a new item for "File Ordering".

I can confirm it works on PDL 3.0.6 running on Joomla 3.4.4.

EDIT: I can confirm this also works on J2.5.28.

Jan : if there are any "CAUTION" messages that should be noted, please advise. For example, I suspect that any upgrade to 3.0.6 will over write the edits and so will need to be regenerated manually after the upgrade.

Of course, it might be just as easy Jan for you to include this code chunk in the XML file and include it in the com_ installer when releasing the next version? Just a suggestion! :wink:

EDIT: I unzipped the com installer and replaced the default.xml file for the above patched version and then re-zipped the folder. All was well and it installed well onto a J3.4.4 site and the file sorting options are visible in the Options tab. I have therefore saved the com installer locally as com_phocadownload_v3.0.6_patched.zip and will be able to use this for future installs.

Good luck and many thanks Jan!

Chris

Re: PDL File Sorting Issues

Posted: 20 Sep 2015, 12:10
by Jan
Hi, thank you very much for the guide.

Yes, you need to backup your XML and always - when updating - you need to copy your own.

For now, I think, there is no other possible problem regarding this. :idea:

Thank you, Jan

Re: PDL File Sorting Issues

Posted: 20 Sep 2015, 12:54
by tapiochre
I think you are correct!

Thanks Jan