Page 1 of 1

[SOLVED]How can we expand attributes of the cmsms image tag?

Posted: Sat Jun 29, 2013 8:23 pm
by blackhawk
I'm using CMSMS 1.11.7

What is a good learning guide on how to expand the cmsms {image} tag, so that every time I use it, it will automatically apply alt="" to any image?

I don't want to type alt="" every time I use the {image} tag because I have tons of images.

Right now its doing something like...
alt="[/web/ffa.png]"

Thanks for any advice!
bh

Re: How can we expand attributes of the cmsms image tag?

Posted: Sun Jun 30, 2013 12:02 pm
by velden
You might want to check the 'addtext' parameter:

Code: Select all

{image src="something.jpg" addtext='alt=""'}
;D

Why don't you use a search replace? Or create a UDT.

Re: How can we expand attributes of the cmsms image tag?

Posted: Sun Jun 30, 2013 12:12 pm
by Rolf
Similar problem? http://www.cmscanbesimple.org/blog/call ... from-a-udt
with a solution in an UDT

Re: How can we expand attributes of the cmsms image tag?

Posted: Sun Jun 30, 2013 12:31 pm
by blackhawk
Velden, for some reason that code has now effect on the image tag. the DOM is still processing alt=[web/image.jpg] when you view it through the console window.

Rolf I think that works! I'll play it it.

Thanks guys

Re: How can we expand attributes of the cmsms image tag?

Posted: Sun Jun 30, 2013 12:48 pm
by blackhawk
I created the following UDT, {img}..

Code: Select all

$src = isset($params['src']) ? $params['src'] : '';
$smarty_data = "{image src='".$src."' alt=' '}";
$smarty->display('eval:'.$smarty_data);
It appears to work with...

Code: Select all

{img src="web/ffa.png"}
on my content pages

thanks!