Page 1 of 1

Category-Name in Photoswipe-Footer?

Posted: 31 Mar 2026, 13:02
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

Re: Category-Name in Photoswipe-Footer?

Posted: 31 Mar 2026, 17:08
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

Re: Category-Name in Photoswipe-Footer?

Posted: 01 Apr 2026, 01:17
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

Re: Category-Name in Photoswipe-Footer?

Posted: 01 Apr 2026, 01:34
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

Re: Category-Name in Photoswipe-Footer?

Posted: 06 Apr 2026, 12:14
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