Category view is not responsive

Phoca Gallery - image gallery extension
jb80
Phoca Enthusiast
Phoca Enthusiast
Posts: 59
Joined: 16 Feb 2013, 16:53

Category view is not responsive

Post by jb80 »

I found an issue where the category view (categories above Images) thumbnail image is not responsive. This is a problem for my site as my thumbnail images are larger than the configured box size (for better clarity). The solution is to simply insert the
class="pg-image img img-responsive"
as done on the category view image page.

The question that I have is which source files need to be modified to fix this problem and whether the core PG code will be updated.

Jason

Class in PG v4.3.4

Code: Select all

<img src="/joomla/images/phocagallery/category1/category2/thumbs/phoca_thumb_m_pa030688.jpg" alt="" class="pg-cat-image" itemprop="thumbnail">
Correct code with class="pg-image img img-responsive"

Code: Select all

<img src="/joomla/images/phocagallery/category1/category2/thumbs/phoca_thumb_m_pa030820.jpg" alt="" class="pg-image img img-responsive" itemprop="thumbnail">
jb80
Phoca Enthusiast
Phoca Enthusiast
Posts: 59
Joined: 16 Feb 2013, 16:53

Re: Category view is not responsive

Post by jb80 »

I am guessing there is some code missing somewhere which checks whether the view is configured to be "responsive" :idea: . I found a section in com_phocagallery\views\category\view.html.php related to Overlib class but not the one in question :idea:

I am requesting some help to identify where and how to fix this issue. Thanks.

Code: Select all

// Overlib class
if ($this->items[$iS]->overlib == 0) {
	$this->items[$iS]->ooverlibclass = array('class' => 'pg-image img img-responsive', 'itemprop' => "thumbnail");
} else { 
	$this->items[$iS]->ooverlibclass = array('class' => 'pimo pg-image img img-responsive img-responsive2', 'itemprop' => "thumbnail");
}
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48752
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Category view is not responsive

Post by Jan »

Hi, can you paste a screenshot which part you exactly mean?

Jan
If you find Phoca extensions useful, please support the project
jb80
Phoca Enthusiast
Phoca Enthusiast
Posts: 59
Joined: 16 Feb 2013, 16:53

Re: Category view is not responsive

Post by jb80 »

Default html with medium 100x100 thumbnail box but using a 150x150 image to slightly improve image clarity
Image

.... and now with the modified html to include the

Code: Select all

class="pg-image img img-responsive"
the image correctly resizes to fit the 100x100 thumbnail box - refer to the yellow highlighted boxes. This responsive behaviour already works correctly on the categories view image list page but not on the parent categories above the image list, i.e. multi level parent/child categories

Image
Last edited by jb80 on 01 Apr 2017, 17:36, edited 1 time in total.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48752
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Category view is not responsive

Post by Jan »

Hi, thank you for the info, I will take a look at it for next version.

The categories in category view are located here:

components\com_phocagallery\views\category\tmpl\default_images.php

Try to change on line cca 130
FROM:

Code: Select all

echo JHtml::_( 'image', $cv->linkthumbnailpath, '', array('itemprop' => "thumbnail"));
TO:

Code: Select all

echo JHtml::_( 'image', $cv->linkthumbnailpath, '', $cv->ooverlibclass);
Jan
If you find Phoca extensions useful, please support the project
jb80
Phoca Enthusiast
Phoca Enthusiast
Posts: 59
Joined: 16 Feb 2013, 16:53

Re: Category view is not responsive

Post by jb80 »

Nope that didn't work, perhaps it is something to do with line # 92 of default_images.php :idea:

The "pg-image" class seems to match but is missing the "img img-responsive" parameter.

Code: Select all

 echo JHtml::_( 'image', $cv->extm, $cv->altvalue, array('style' => 'width:'. $correctImageRes['width'] .'px;height:'.$correctImageRes['height'] .'px;', 'class' => 'pg-image', 'itemprop' => "thumbnail"));
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48752
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Category view is not responsive

Post by Jan »

Hi, test to modify this line - cca 118 (in the same file):

FROM:

Code: Select all

echo JHtml::_( 'image', $cv->linkthumbnailpath, '', array( 'class' => PhocaGalleryRenderFront::renderImageClass($cv->linkthumbnailpath), 'itemprop' => "thumbnail") );
TO:

Code: Select all

echo JHtml::_( 'image', $cv->linkthumbnailpath, '', array( 'class' => PhocaGalleryRenderFront::renderImageClass($cv->linkthumbnailpath) . ' pg-image img img-responsive', 'itemprop' => "thumbnail") );
Jan
If you find Phoca extensions useful, please support the project
jb80
Phoca Enthusiast
Phoca Enthusiast
Posts: 59
Joined: 16 Feb 2013, 16:53

Re: Category view is not responsive

Post by jb80 »

That did the trick! :D The code change worked perfectly :) Thank you.

Code: Select all

echo JHtml::_( 'image', $cv->linkthumbnailpath, '', array( 'class' => PhocaGalleryRenderFront::renderImageClass($cv->linkthumbnailpath) . ' pg-image img img-responsive', 'itemprop' => "thumbnail") );
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48752
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Category view is not responsive

Post by Jan »

Ok, I will set it for the next version.

Jan
If you find Phoca extensions useful, please support the project
juma_2015
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 27 Jul 2017, 14:04

Re: Category view is not responsive

Post by juma_2015 »

Hello,

I have exactly the same issue, my page with category, category is not responsive. But the images gallery inside the category is.

I tried the code above, but it doesnt seem to have change anything.

Anything else to try ?

Thanks in advance

Julien
Post Reply