Require Alternate Text when Inserting Image

Mike Bilz asked on April 14, 2017 18:01

Hello Kentico Team,

Is it possible to make the "Alternate Text" field a required field when a user adds an image to a page with the "Insert/Edit Image or Media" button?

I feel that if I don't make the alt tag mandatory, many of my editors will skip this important accessibility step.

Any assistance would be greatly appreciated. Thanks.

-Mike

Recent Answers


Chetan Sharma answered on April 14, 2017 18:19

Depends upon how are you implementing this. We use form which is linked with media library. We also keep alt img text field on the form (Tied up with page type). We will keep this mandatory an that will force editors to add some text thereby resolving this issue.

What is your approach?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on April 14, 2017 18:25

You could just add the alt text in the transformation based on the image name or document name the user adds depending on the page type and requirements.

Also I believe you can do this with a validation rule. On the alt text field, click the Add Validation rule button. In there you may be able to use a compare or general rule to accomplish this.

0 votesVote for this answer Mark as a Correct answer

Mike Bilz answered on April 14, 2017 18:32

Hi Chetan,

My question is specifically about altering the "Insert/Edit Image or Media" tool in the WYSIWYG editor.

My pages have an Editable Text web part as the main content area, and I want to require that any images added to this text area have to have Alt Tags. Or more broadly, that any image that is included through the WYSIWYG editor requires an Alt Tag.

-Mike

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on April 14, 2017 18:35

Unfortunately Mike, without some customization on the back-end of Kentico and possibly the CKEditor, this isn't possible. I'd look into something more robust like a custom webpart/widget or even using page types.

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on April 14, 2017 19:34 (last edited on April 14, 2017 19:54)

Mike, maybe ... you can look at the page/control for the media library insert popup (\CMSModules\Content\Controls\Dialogs\Properties\HTMLMediaProperties.ascx) and add some validation to the ALT text field (<cms:CMSTextBox ID="txtAlt" runat="server" />), so it cannot be save & closed if it's empty.

0 votesVote for this answer Mark as a Correct answer

Mike Bilz answered on April 14, 2017 19:41

Hi Brenden,

I assumed as much, and I'm happy to take a crack at it. Do you happen to know which file I would need to alter in the CKEditor to make this change?

-Mike

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on May 13, 2017 09:16

Hi Mike,

Your best bet is to train your content editors to follow the content guidelines of entering the data correctly as per your needs.

We work with CE on a large scale efforts. Probably we have 10 CE just doing contribution on our multiple projects.

This can be easily handled by WYSIWYG by going to the source and add alt tag to it.

We have this on our content guidelines as we care deeply about accessibility. A little training will go a long way rather than finding programming solution for this.

Sharing through my experience I could be wrong too. That's how we addressed this after juggling for 4 years.

My $0.02

Thanks Chetan

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.