Album creates an ALT attribute by combining the title and comments entered, but it's showing the tags as well; when I hover over an image I see something like:
Title of Image - Comment about the image
Here's an example:
http://nawwstraw.org/index.php?mact=Album,m2,default,1&m2albumid=4&m2returnid=55&page=55
Is there a way to set this up so that the tags are not displayed? I'm using Simple-Separate-Pages template if that helps.
[SOLVED] Album - show no HTML in img ALT attribute?
[SOLVED] Album - show no HTML in img ALT attribute?
Last edited by kanjigirl on Thu Oct 16, 2008 8:30 pm, edited 1 time in total.
Re: Album - show no HTML in img ALT attribute?
Yes you should strip them out in the template, tags are not allowed in ALT or TITLE tags. SMARTY http://www.smarty.net/docs.php manual is your friend here.
Something like...
{eval var=$variable->variable_name|strip_tags:false}
Something like...
{eval var=$variable->variable_name|strip_tags:false}
Re: Album - show no HTML in img ALT attribute?
Thank you - I'll take a look at this in detail later today.
Re: Album - show no HTML in img ALT attribute?
Here's how to keep code from showing in ALT attributes in Album's Simple-Separate-Pages template:
Find this...
And replace"escape:'html'" in the title attribute's two parts with "strip_tags" like this:
Find this...
Code: Select all
<img src="{$picture->picture}" class="bigpicture-centered" alt="{$picture->name|escape:'html'} - {$picture->comment|escape:'html'}" title="{$picture->name|escape:'html'} - {$picture->comment|escape:'html'}" />
Code: Select all
<img src="{$picture->picture}" class="bigpicture-centered" alt="{$picture->name|escape:'html'} - {$picture->comment|escape:'html'}" title="{$picture->name|strip_tags} - {$picture->comment|strip_tags}" />