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!
Random image for subcategories not displaying properly
-
orangesparkz
- Phoca Member

- Posts: 33
- Joined: 11 Mar 2009, 22:41
- Jan
- Phoca Hero

- Posts: 49297
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Random image for subcategories not displaying properly
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
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
If you find Phoca extensions useful, please support the project
-
orangesparkz
- Phoca Member

- Posts: 33
- Joined: 11 Mar 2009, 22:41
Re: Random image for subcategories not displaying properly
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!
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!
-
orangesparkz
- Phoca Member

- Posts: 33
- Joined: 11 Mar 2009, 22:41
Re: Random image for subcategories not displaying properly
Solved
How to fix the medium thumbnails from displaying in category view:
components/com_phocagallery/helpers/phocagallery.php
Change lines 86-89
How to fix the medium thumbnails from displaying in category view:
components/com_phocagallery/helpers/phocagallery.php
Change lines 86-89
TO: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);
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);
- Jan
- Phoca Hero

- Posts: 49297
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Random image for subcategories not displaying properly
Great,
thank you for this information. Jan
thank you for this information. Jan
If you find Phoca extensions useful, please support the project
-
orangesparkz
- Phoca Member

- Posts: 33
- Joined: 11 Mar 2009, 22:41
Re: Random image for subcategories not displaying properly
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
To:
Sorry for the confusion!
-Cathy
(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);Code: Select all
$file_thumbnail = PhocaGalleryHelperFront::displayThumbOrFolder($random->filename, 'small', $rightDisplayKey);-Cathy
- Jan
- Phoca Hero

- Posts: 49297
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Random image for subcategories not displaying properly
Ok
If you find Phoca extensions useful, please support the project