How to remove the title from the images

Phoca Gallery - image gallery extension
klevis miho
Phoca Member
Phoca Member
Posts: 14
Joined: 08 Jun 2010, 16:40

How to remove the title from the images

Post by klevis miho »

How can I remove the title from the images (the title="" attribute)?
Because it gets the title from the image file name.
imperialWicket
Phoca Enthusiast
Phoca Enthusiast
Posts: 78
Joined: 28 Feb 2010, 15:39

Re: How to remove the title from the images

Post by imperialWicket »

Strictly speaking, the html uses the Phoca Gallery Image Title field to populate the 'title' attribute - but this value defaults to the filename.

You can update the Title value to be something more appropriate in the Admin section under Phoca Gallery -> Images. If you just want to remove the title (assuming you are in Category view), the code is in /components/com_phocagallery/views/category/tmpl/default.php (around line 118), the original looks like:

Code: Select all

echo '<a class="'.$value->button->methodname.'"';
if ($value->type == 2) {
	if ($value->overlib == 0) {
		echo ' title="'. $value->title.'"';
	}
}
echo ' href="'. $value->link.'"';
Commenting out the echo title, or hard-coding some value will also affect the displayed value - something like:

Code: Select all

echo '<a class="'.$value->button->methodname.'"';
if ($value->type == 2) {
	if ($value->overlib == 0) {
		// COMMENT OUT
                //echo ' title="'. $value->title.'"';
                // OR MODIFY
                //echo ' title="The title I want to display."'; 
	}
}
echo ' href="'. $value->link.'"';
Hope this helps.
Post Reply