[solved]Can we modify content_image block alt tags etc??

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

[solved]Can we modify content_image block alt tags etc??

Post by ladyr0gue »

I am using {content_image block='Image1' dir='images'} in my template to call an editable image block. With this block I can call any image but I can't find a way to edit each images alt tags (or name, title) all the image alt tags and name tags are Image1 as the name of the content block. Is there any way to do this this short of calling each image individually into a content block? I don't want to use this method really as editors have permissions to modify pages and choose images but I don't want them to have to enter code to do so...

Descriptive alt tags are not incredibly important to me for accessibility as all the images have descriptive names. And there's plenty of actual content anyway. But I did like having titles for when people hovered over the images :-\

1.10.3
Last edited by ladyr0gue on Sun Apr 22, 2012 9:05 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Can we modify content_image block alt tags etc??

Post by calguy1000 »

in the help for the {content_image} tag it describes the 'alt' param.

i.e: {content_image alt='some name' block='foo'}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

Re: Can we modify content_image block alt tags etc??

Post by ladyr0gue »

calguy1000 wrote:in the help for the {content_image} tag it describes the 'alt' param.

i.e: {content_image alt='some name' block='foo'}
Hi, thanks for replying - I can see that I can enter the alt or title there, but as the content_image block is within my template that would give a generic alt or title tag to all the images I display throughout my website... which at present it does anyway taking the alt from the block name. I was wondering if there was a way to specify an alt tag or title block so an editor or admin could add an image and then add alt text / title text on a per-page, per-image basis?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Can we modify content_image block alt tags etc??

Post by calguy1000 »

Use a one line content block.

i.e:

Code: Select all

{content block='alt_tag' oneline=true' assign='alt'}
{assign var='alt' value=$alt|strip_tags|cms_escape}{* in case users enter wonky stuff *}
{content_image block='foo' alt=$alt}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

Re: Can we modify content_image block alt tags etc??

Post by ladyr0gue »

thanks again - it nearly worked but it doesn't like my {content_image block='Image1' alt=$alt} ... it returns
Image1:
Error retrieving file list
...?

apart from that should this method work the same for title tags?
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

Re: Can we modify content_image block alt tags etc??

Post by ladyr0gue »

d'oh sorry - I forgot to specificy the dir= :-[ thanks again :)
Post Reply

Return to “CMSMS Core”