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

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
kanjigirl
Forum Members
Forum Members
Posts: 52
Joined: Fri Aug 01, 2008 11:23 pm

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

Post 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.
Last edited by kanjigirl on Thu Oct 16, 2008 8:30 pm, edited 1 time in total.
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

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

Post 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}
kanjigirl
Forum Members
Forum Members
Posts: 52
Joined: Fri Aug 01, 2008 11:23 pm

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

Post by kanjigirl »

Thank you - I'll take a look at this in detail later today.
kanjigirl
Forum Members
Forum Members
Posts: 52
Joined: Fri Aug 01, 2008 11:23 pm

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

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

Return to “Modules/Add-Ons”