Search Plugin: Direct link to image on "No Popup" option

caro23
Phoca Member
Phoca Member
Posts: 22
Joined: 12 Jul 2008, 17:15

Search Plugin: Direct link to image on "No Popup" option

Post by caro23 »

Hello all,

The search plugin usually links to the category page. However, when using the "No pupop" detail view option, one can link directly to the picture instead.

Solution: change line 223 in /plugins/search/phocagallery/phocagallery.php:

Code: Select all

$listImages[$key]->href = JRoute::_(PhocaGalleryRoute::getCategoryRoute($value->catid, $value->catalias));
to this:

Code: Select all

// If the detail window is not a pupop (7) then we can directly link to the image itself.
if ($paramsC->get('detail_window') == 7)  {
   $listImages[$key]->href = JRoute::_(PhocaGalleryRoute::getImageRoute($value->id, $value->catid, $value->slug, $value->catalias));
}
else {
    $listImages[$key]->href = JRoute::_(PhocaGalleryRoute::getCategoryRoute($value->catid, $value->catalias));
}						}
Mabye the developers want to consider this in their regular release.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48023
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Search Plugin: Direct link to image on "No Popup" option

Post by Jan »

Hi,

thank you for this info, I will change it for the next release.

Jan
If you find Phoca extensions useful, please support the project
RickIngham
Phoca Member
Phoca Member
Posts: 21
Joined: 20 Jan 2013, 01:20

Re: Search Plugin: Direct link to image on "No Popup" option

Post by RickIngham »

Sorry to bring this to the top again but I wandered if anyone had any success linking image results to a lightbox/modalbox instead of it going to category view. In my opinion a search engine that takes you to a page with lots of results isnt really much help.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48023
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Search Plugin: Direct link to image on "No Popup" option

Post by Jan »

Hi, search component - this is the one which displayed the search outcomes does not have any lightbox feature - so this needs to be customized in the search component - see similar posts where I have explained it. The search outcomes are rendered by other component and if it is running, you cannot do any changes in Phoca Gallery as it does not run in case of search outcomes - so for this you need to customize the core joomla search component (see similar posts in the forum).

Jan
If you find Phoca extensions useful, please support the project
RickIngham
Phoca Member
Phoca Member
Posts: 21
Joined: 20 Jan 2013, 01:20

Re: Search Plugin: Direct link to image on "No Popup" option

Post by RickIngham »

Thanks Jan but I have searched the forum many times and have not found any posts explaining that. There are similar questions but nothing specifically explaining how to make it open a lightbox (or similar)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48023
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Search Plugin: Direct link to image on "No Popup" option

Post by Jan »

Hi, yes, there is no guide how to do it (I think), because it cannot be done in any Phoca extension. This needs to be done directly in com_search component.

In fact you need to load there:
- some javascript library (popup)
- add the event (onclick, rel, etc. depends on used library) to a tag
- ...

Jan
If you find Phoca extensions useful, please support the project
Post Reply