Page 1 of 1

File link problem Modification in Search Plugin

Posted: 15 Mar 2014, 16:11
by roncrisco
I installed Phoca Download 3.0.4 and the Search Plugin 3.0.1 and most things worked great (thank you!)

However, when I used Joomla Search, the results page always linked to the Phoca Download Category page instead of linking to individual items. I modified the file plugins/search/phocadownload/phocadownload.php to correct this problem, and include the changes I made below.

Added the alias to line 243

Code: Select all

. ' "2" AS browsernav, c.id as catid, c.alias as catalias, a.alias');
Used the alias to get correct route in line 273

Code: Select all

$listFiles[$key]->href = JRoute::_(PhocaDownloadRoute::getFileRoute($value->id,$value->catid,$value->alias, $value->catalias, 0, 'default'));

Re: File link problem Modification in Search Plugin

Posted: 18 Mar 2014, 01:27
by Jan
Hi, as default there is no file view in Phoca Download, this is why the search plugin makes a link to category view where the searched file is included. Yes, if someone uses the File view, this needs to be customized in the code.

Jan

Re: File link problem Modification in Search Plugin

Posted: 18 Mar 2014, 15:35
by lucianoecunha
But it still keeps writing on the url the menu item id from Categories View.
How can we change it to fileview menu id.

Re: File link problem Modification in Search Plugin

Posted: 20 Mar 2014, 12:29
by Jan
Hi, this is right, it just uses the menu link to create SEF - there is a tree - categories - category - file and back and such needs to have one menu link itemid for always the same url (changing urls in tree is not eligible). See: https://www.phoca.cz/documents/16-joomla ... -in-joomla

Jan

Re: File link problem Modification in Search Plugin

Posted: 20 Mar 2014, 15:09
by lucianoecunha
Sorry Guys,

I already created the menu links to the componet, but I only works with the id of Categories View.

When I do the search por example 3243, it return the link agoasanta.mg.gov.br/index.php/listoffiles0/file/4410-3243-de-16-01-2012, but these sef is from the categories view. If I manually correct the link to lagoasanta.mg.gov.br/index.php/fileview/file/4410-3243-de-16-01-2012 it works perfectly.

This site is already in production but in my test website i dont have sef enabled then it happens too. It always use the id from Categories View.

Re: File link problem Modification in Search Plugin

Posted: 25 Mar 2014, 19:25
by Jan
Hi, did you read the articles listed above in the link? Search tries to find a menu link and if if finds it, then it uses this id to build SEF link with help of JRoute method.

Jan