21
Peekay
Re: Alt Tag on Images
  • 2005/12/11 1:35

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


@Ted. If you can get into the habit of adding an 'alt' attribute to significant images, your site will be more accessible to people using assisted technology browsers than if you don't. It's good to see that XOOPS is providing this feature.

Actually, it is handy to be able to change the alt tag each time you use an image (e.g via Koivi), because it's meaning can vary each time you use it. E.g. in one story a picture might be described as "An egg". In another, "An egg, like the one thrown at the prime minister"

To fully meet accessibility requirements (not guidelines) demands considerable diligence when creating static sites, let alone CMS solutions. There are numerous pitfalls and very few CMS products make the grade. Of the solutions we looked at recently, PHPWebsite does the best, but the trade-off is limited functionality. It is however the only CMS with which I could successfuly post to a forum using Lynx, the text browser.

My website design company considers that if a site works logically in Lynx we have met our accessibility obligations. No images. No CSS. If a client wants a site to work in a privately produced AT browser for which the browser developers charge £1200 per user license... we price our site design accordingly.

It is a great shame that the open source developer community has not looked at developing free AT browser solutions. This might perhaps break the 'council gets grant - council employees keep their job - suppliers make fortune selling at high price to council (who pays through grant)' cycle.
A thread is for life. Not just for Christmas.

22
m0nty
Re: Alt Tag on Images
  • 2005/12/11 3:54

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


adding a user inputtable alt tag field to the imagemanager shouldn't be too difficult.

however getting all the templates and outputs to show the alt tag will take a lot longer..

23
m0nty
Re: Alt Tag on Images
  • 2005/12/11 5:22

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


ok have hacked the image manager of XOOPS 2.2.3 and can now define an alt tag for each image uploaded. works fine :)

however to utilise it properly i need to be able to set the alt tag in the xoopscode..

i'm presuming this needs to be done through module.textsanitizer.php

$patterns[] = "/[img align=(['"]?)(left|center|right)\1]([^"()?&'<>]*)[/img]/sU";
        
$patterns[] = "/[img]([^"()?&'<>]*)[/img]/sU";
        $patterns[] = "/[img align=(['"]?)(left|center|right)\1 id=(['"
]?)([0-9]*)\3]([^"()?&'<>]*)[/img]/sU";
        
$patterns[] = "/[img id=(['"]?)([0-9]*)\1]([^"()?&'<>]*)[/img]/sU";
        if (
$allowimage != 1) {
            
$replacements[] = '<a href="\3" target="_blank">\3</a>';
            
$replacements[] = '<a href="\1" target="_blank">\1</a>';
            
$replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\4" target="_blank">\4</a>';
            
$replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\2" target="_blank">\3</a>';
        } else {
            
$replacements[] = '<img src="\3" align="\2" alt="" />';
            
$replacements[] = '<img src="\1" alt="" />';
            
$replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\4" align="\2" alt="\4" />';
            
$replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\2" alt="\3" />';
        }


however i don't know how to to edit the alt="" in the above $replacements so it provides the image_altname of the image used..

any1 have any knowledge on how to do this?

Login

Who's Online

179 user(s) are online (97 user(s) are browsing Support Forums)


Members: 0


Guests: 179


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits