Category-Name in Photoswipe-Footer?

Phoca Gallery - image gallery extension
fawin
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 31 Mar 2026, 12:36

Category-Name in Photoswipe-Footer?

Post by fawin »

[Joomla 6.0.3]
[Phoca Gallery 6.0.1]

Hello everyone,

First of all, thank you to all the volunteer developers who create and support such a great component!

I’ve been working with Joomla for several years, but I’ve only been using Phoca Gallery for a few days.

I’d like to display different galleries from different categories in a single post.
To do this, I’m using the syntax: {phocagallery view=category|categoryid=1}

My question is: How can I display the category name of the image in the footer of the Photoswipe detail view?

I always read about descriptions and/or title in the backend, but is it also possible to display the category?

It would also be nice if you could disable the "Share" icons in the top-right corner of the Photoswipe detail view.



Where do I need to configure this?

I would really appreciate a quick tip.

Thank you very much and best regards,
Fabian
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49323
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Category-Name in Photoswipe-Footer?

Post by Jan »

Hi, no, there is no such option, so this needs to be customized directly in the code:
administrator/components/com_phocagallery/libraries/phocagallery/image/imagefront.php
line cca 1139: switch ($t['photoswipe_display_caption']) {

and add to selected part the category information.

Jan
If you find Phoca extensions useful, please support the project
fawin
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 31 Mar 2026, 12:36

Re: Category-Name in Photoswipe-Footer?

Post by fawin »

Hi Jan,

Thank you very much for your quick reply!

I have modified the file administrator/components/com_phocagallery/libraries/phocagallery/image/imagefront.php for testing as follows:

Code: Select all

			switch ($t['photoswipe_display_caption']) {
				case 0:
					$item->photoswipecaption = 'TEST_case_0';
					break;

				case 2:
					$item->photoswipecaption = PhocaGalleryText::strTrimAll(( $item->description)).'TEST_case_2';
					break;

				case 3:
					$item->photoswipecaption = PhocaGalleryText::strTrimAll(($item->title));
					if ($item->description != '') {
						$item->photoswipecaption .='<br />' .PhocaGalleryText::strTrimAll(($item->description)).'TEST_case_3';
					}
					break;

				case 1:
				default:
					$item->photoswipecaption = PhocaGalleryText::strTrimAll(($item->title)).'TEST_case_1';
					break;
			}
Unfortunately, the Photoswipe detail view doesn’t change, no matter what I select under ‘Display Caption (Photoswipe)’ in the Phoca Gallery plugin.

I would also like to include the image description, but unfortunately you can’t specify this for all images in the relevant category during a batch upload. Entering the description manually for each image one by one afterwards simply takes too long when there are over 100 images per category.

Thank you very much for your help. :-)

Best regards,
Fabian
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49323
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Category-Name in Photoswipe-Footer?

Post by Jan »

Hi, if you use the plugin, it needs to be changed directly in plugin code:
plugins/content/phocagallery/phocagallery.php, line cca 716
If you find Phoca extensions useful, please support the project
fawin
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 31 Mar 2026, 12:36

Re: Category-Name in Photoswipe-Footer?

Post by fawin »

Hi Jan,

Thanks again for your quick reply! :-)

Unfortunately, $v->category doesn't return any output. I was hoping to use it to display the name of the image category.

I had to change the query in line 539 as follows:

Code: Select all

$query = 'SELECT a.id, a.catid, a.title, a.alias, a.filename, a.description, a.extm, a.exts, a.extw, a.exth, a.extid, a.extl, a.exto, c.title AS category'
    . ' FROM #__phocagallery AS a'
    . ' LEFT JOIN #__phocagallery_categories AS c ON c.id = a.catid'
    . ' WHERE a.published = 1'
    . ' AND a.approved = 1'
    . $where
    . $ordering['output']
    . $limit;
I hope you don't mind my code hack.

Is this actually update-safe?

Thank you very much and best regards,
fawin
Post Reply