Page 1 of 1
Random image for subcategories not displaying properly
Posted: 25 Mar 2009, 00:05
by orangesparkz
I am having trouble with the image next to subcategory name. I would like it to be the random images which I set to 'yes' in the parameters. This works great when the page is viewed with all categories and subcategories, but when a page with just subcategories is viewed, it displays the folder icon instead.
For example, you can see when "Backdrops" selected from the top menu, what that page looks like:
http://www.oliphantstudio.com/main/inde ... s&Itemid=5
Random images showing for subcategories. Perfect.
Verses:
When "Architecture" (or any of the other 3 categories that contain subcategories) is clicked from side menu
http://www.oliphantstudio.com/main/inde ... l&Itemid=5
It shows the subcategories with folder icons.
Any ideas?
Thanks!
Re: Random image for subcategories not displaying properly
Posted: 25 Mar 2009, 13:36
by Jan
Hi, it seems like there the random image as folder icon doesn't work but why?
see it in parameters component:
Display random image as folder icon (I think it will be set to yes, because it is working for categories view but try to check it, maybe there is a "use global" value so it needs to be set to yes)
Jan
Re: Random image for subcategories not displaying properly
Posted: 25 Mar 2009, 18:22
by orangesparkz
Yes! That was why it was showing the folder icon. In the Menu item (In Menu Manager) parameters under Category View Settings (Thumbnails)-- "Display random image as folder icon" was set to global. Changing it to "Yes" worked.
But it links to medium image size, as you can see in the image attached, I need to change it to small image.
I tried to find the code to change in some php files, without success. Do you know which file and lines of code I need to change so it pulls the small image instead of the medium?
Thank you!
Re: Random image for subcategories not displaying properly
Posted: 27 Mar 2009, 21:24
by orangesparkz
Solved
How to fix the medium thumbnails from displaying in category view:
components/com_phocagallery/helpers/phocagallery.php
Change lines 86-89
case 'medium':
$filename_thumbm = 'phoca_thumb_m_'. $filename_orig;
$thumbnail_name['abs'] = str_replace ($filename_orig, 'thumbs/' . $filename_thumbm, $filename_orig_path_abs);
$thumbnail_name['rel'] = str_replace ($filename_orig, 'thumbs/' . $filename_thumbm, $filename_orig_path_rel);
TO:
case 'medium':
$filename_thumbs = 'phoca_thumb_s_'. $filename_orig;
$thumbnail_name['abs'] = str_replace ($filename_orig, 'thumbs/' . $filename_thumbs, $filename_orig_path_abs);
$thumbnail_name['rel'] = str_replace ($filename_orig, 'thumbs/' . $filename_thumbs, $filename_orig_path_rel);
Re: Random image for subcategories not displaying properly
Posted: 30 Mar 2009, 15:08
by Jan
Great,
thank you for this information. Jan
Re: Random image for subcategories not displaying properly
Posted: 31 Mar 2009, 20:14
by orangesparkz
After I applied this hack, I realized that it also changed my rollover thumbnails back to the smallest image as well. I still want those to be my medium size.
(This whole post is a result of applying the small/medium/large image hacks used here:
viewtopic.php?f=1&t=3529
So instead of the previous code to components/com_phocagallery/helpers/phocagallery.php file, if you just want those subcategory icons to display random images that use the smallest image size do this change.
In the file: com_phocagallery/models/category.php
line 183
Code: Select all
$file_thumbnail = PhocaGalleryHelperFront::displayThumbOrFolder($random->filename, 'medium', $rightDisplayKey);
To:
Code: Select all
$file_thumbnail = PhocaGalleryHelperFront::displayThumbOrFolder($random->filename, 'small', $rightDisplayKey);
Sorry for the confusion!
-Cathy
Re: Random image for subcategories not displaying properly
Posted: 02 Apr 2009, 01:14
by Jan
Ok