Tips

Category: Phoca Gallery Component
 

Tips

1. Image representing a gallery (category)

In Phoca Gallery you can display different images/icons which will represent the gallery (category):
 
  • Image - when editing category, image can be selected and this will represent the category
  • Folder icon - can be set in parameters
  • Avatar - can be set in parameters
  • Image from the category - it can be random image but even an image with specific ordering (e.g. first image from the category will be set). If you want to display an image as category icon and you don't want to display such image in list of category, then you set the first image as unauthorized. Such image will be displayed as category icon but will be not displayed in list of images. (Don't forget to set right ordering of images which should be selected as folder icon, if you have unauthorized first image, then the ordering must be ordered by ordering, so the first unauthorized image will be selected)

 

See Options (Parameters) to set the image.

 

The parameter Display image instead of folder icon displays the folder icon as default, here the image from the category can be set. If the image will be set, then you can set the specific image from the category (subcategory) with help of ordering: Categories Image Ordering. So you can set, e.g. first image from the category will be displayed as category image.

 

 

2. How to disable "save image as" after right clicking

If you want to disable context menu "save image as" after right clicking, just customize the template of view where you want to apply this.

E.g. Detail View in Phoca Gallery. Edit:

components/com_phocagallery/views/detail/tmpl/default.php

and add the following code to the top of the code:

 

$document    = &JFactory::getDocument();
$document->addScript(JURI::base(true).'/components/com_phocagallery/assets/jquery/jquery-1.6.4.min.js');
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($){
jQuery('img').bind('contextmenu', function(e){
return false;
});
});
</script>

 

JQuery version 1.6.4 is included in Phoca Gallery since version 3.1. Before this version include JQuery version 1.6.2.
 
 

3. Changing word "category" to other word in URL (SEF link) of Phoca Gallery (or other Phoca extension)

 
Be aware, this guide is experimental and not tested well, it is designed for webdesigners with knowledge of PHP and Joomla! framework and it means as a tip for developing this feature.

 

To change the string in URL, two methods in core PHP files of Phoca Gallery (or other Phoca extension) need to be changed:
  • PhocaGalleryBuildRoute - one which will build the modified URL
  • PhocaGalleryParseRoute - second which will parse the modified URL and will translate it to standard URL
Both methods can be found in:
  • components/com_phocagallery/router.php file.

Open the file and find the following string:

return $segments;

at the bottom of the method PhocaGalleryBuildRoute

Add the following code:

if (!empty($segments)) {
foreach ($segments as $k => $v) {
if ($v == 'category') {
$segments[$k] = 'Kategorie';
}
}
}

before (above) this string. Change the word "Kategorie" to your own word you want to get in your URL. Now links will be build with "Kategorie" instead of "category" in Phoca Gallery. Such links need to be translated back so Phoca Gallery and Joomla! understand them. See the PhocaGalleryParseRoute method.

Find this string:

case 'category'   :
 

and change it to:

case 'Kategorie'   :
 
 
If you find this guide not complete, please make a feedback in Phoca Forum. Thank you.