Hi Joomlaworks-Community
I recently bought the pro extension because I work a lot with the K2 extension. Pretty nice extension, but something important was missing ...
IPTC support!
Very disapointing, especially if users are asking for it since 2008 - so I made it myself.
I know it's probably not the best solution but it works for me - I'm only the paying customer and normally this shouldn't be my task.
Greetings Fabio Pajalunga
Here is a short tutorial
Warning 1 You will overwrite parts of the extension - after the changes you won't be able to switch to "show generic messages" in sigpro!
Warning 2 Performing extension updates will probably overwrite the changes.
1. Open the language file located in administrator folder, we're changing the dropdown value in backend (see screen 1 below)
PATH
administrator/language/en-GB/en-GB.plg_content_jw_sigpro.ini
Find this:
JW_SIGP_XML_SHOW_GENERIC_MESSAGES="Show generic messages"
replace it with:
JW_SIGP_XML_SHOW_GENERIC_MESSAGES="Show IPTC Headline / Description"
save & close
2. Open the PHP file with an editor, we're implementing the IPTC functionality
PATH
plugins/content/jw_sigpro/jw_sigpro/includes/helper.php
Find this (~line 200):
elseif ($showcaptions == 1)
{
$gallery[$key]->captionTitle = JText::_('JW_SIGP_LABELS_03');
$gallery[$key]->captionDescription = JText::_('JW_SIGP_LABELS_04').'
<span class="sigProPopupCaption">'.$itemTitle."</span>";
}
Replace it with:
elseif ($showcaptions == 1)
{
// get title and description via iptcparse
$arrSizeIPTC = getimagesize($original,$arrInfoIPTC);
$arrIPTC = iptcparse($arrInfoIPTC['APP13']);
if(is_array($arrIPTC)) {
$arrReturnTitleIPTC = $arrIPTC['2#105'][0];
$arrReturnDescriptionIPTC = $arrIPTC['2#120'][0];
}
$gallery[$key]->captionTitle = $arrReturnTitleIPTC;
$gallery[$key]->captionDescription = '<span style="font-weight:bold">'.$arrReturnTitleIPTC.'</span>
'.$arrReturnDescriptionIPTC;
}
3. Go to the sig pro configuration in your joomla backend plugins and switch the default caption labeling to IPTC
4. enjoy your frontend!
gallery view
image-detail view