Page 1 of 1

[SOLVED] Album - show no HTML in img ALT attribute?

Posted: Tue Oct 14, 2008 5:30 pm
by kanjigirl
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.

Re: Album - show no HTML in img ALT attribute?

Posted: Wed Oct 15, 2008 9:55 am
by Russ
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}

Re: Album - show no HTML in img ALT attribute?

Posted: Wed Oct 15, 2008 3:10 pm
by kanjigirl
Thank you - I'll take a look at this in detail later today.

Re: Album - show no HTML in img ALT attribute?

Posted: Thu Oct 16, 2008 8:29 pm
by kanjigirl
Here's how to keep code from showing in ALT attributes in Album's Simple-Separate-Pages template:

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'}" />
And replace"escape:'html'" in the title attribute's two parts with "strip_tags" like this:

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}" />