File link problem Modification in Search Plugin

Phoca Download - download manager
roncrisco
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 15 Mar 2014, 16:01

File link problem Modification in Search Plugin

Post 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'));
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48568
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: File link problem Modification in Search Plugin

Post 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
If you find Phoca extensions useful, please support the project
lucianoecunha
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 28 Jan 2014, 15:55

Re: File link problem Modification in Search Plugin

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48568
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: File link problem Modification in Search Plugin

Post 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
If you find Phoca extensions useful, please support the project
lucianoecunha
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 28 Jan 2014, 15:55

Re: File link problem Modification in Search Plugin

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48568
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: File link problem Modification in Search Plugin

Post 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
If you find Phoca extensions useful, please support the project
Post Reply