Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Possible to make ALT tag dynamic??

Reply
Thread Tools

Possible to make ALT tag dynamic??

 
 
Jib
Guest
Posts: n/a
 
      09-16-2006
My site caters to different languages and the site has directories
segregated by country, however some of my images are in shared folders. I
can't (or shouldn't) use 'one language fit all' approach for my alt tags and
the site structure is a bit complex to re-configuring it. I really want to
use alt text, so is there any solution that anyone knows about that I can
use? Maybe javascript mouse over which shows the appropriate text depending
on which country the user is browsing?? I'm grasping here...


 
Reply With Quote
 
 
 
 
SteveSomebody
Guest
Posts: n/a
 
      09-16-2006
Jib wrote:
> My site caters to different languages and the site has directories
> segregated by country, however some of my images are in shared folders. I
> can't (or shouldn't) use 'one language fit all' approach for my alt tags and
> the site structure is a bit complex to re-configuring it. I really want to
> use alt text, so is there any solution that anyone knows about that I can
> use? Maybe javascript mouse over which shows the appropriate text depending
> on which country the user is browsing?? I'm grasping here...


Steve replied;
not familiar enough with Javascript to comment, but I'm certain you
could do it with JS. (although you would exclude users who didn't have
JS turned enabled).

How you do this depends on how your site is set up. If your site has
separate content in different languages then you can simply put your
alt = within the content using a different tag for each language.

Alternatively, you could use a server side language such as PHP or ASP
to generate the tag depending on the language defined in
HTTP_ACCEPT_LANGUAGE.

Come back if this isn't clear!

Steve
www.fontmadness.com
"How much can one body take? The concrete shoes, the hungry lake"

 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      09-16-2006

Jib wrote:

> My site caters to different languages and the site has directories
> segregated by country, however some of my images are in shared folders.


Alt text is stored in the HTML, not the image itself. Just use
multiple language versions, same as the page text.

 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      09-16-2006
Jib wrote:

> My site caters to different languages


That would be easier to believe if you had posted a URL.

> and the site has directories
> segregated by country,


I thought you mentioned languages. Please do not try to get any further in
multilingualism before you understand the difference between language and
country.

> however some of my images are in shared folders.


That's really irrelevant to anything but your web site management, and it
has nothing particular to do with multilingualism or alt texts.

> I can't (or shouldn't) use 'one language fit all' approach
> for my alt tags


Just as you shouldn't use 'one language fit all' approach for your textual
content. The alt text (called "alt tag" by people who don't know the basic
concepts of markup) _is_ logically part of textual content, though you need
to write it as an attribute value, due to an old mistake in the design of
HTML.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
Jib
Guest
Posts: n/a
 
      09-16-2006

"Jukka K. Korpela" <(E-Mail Removed)> wrote in message
news:0aROg.13106$(E-Mail Removed). ..
> Jib wrote:
>
>> My site caters to different languages

>
> That would be easier to believe if you had posted a URL.


Your right! I actually made the whole story up! See kids what can happen
when you're bored...


>> and the site has directories
>> segregated by country,

>
> I thought you mentioned languages. Please do not try to get any further in
> multilingualism before you understand the difference between language and
> country.


Boy testy, aren't we? You are bordering on arrogance "Yucca".


>> however some of my images are in shared folders.

>
> That's really irrelevant to anything but your web site management, and it
> has nothing particular to do with multilingualism or alt texts.


You are trying to read way too far into this. You just don't get it.


>> I can't (or shouldn't) use 'one language fit all' approach
>> for my alt tags

>
> Just as you shouldn't use 'one language fit all' approach for your textual
> content. The alt text (called "alt tag" by people who don't know the basic
> concepts of markup) ...


Got me again!
I knew I should have posted a seperate thread to your attention inquiring
about the proper usage of HTML terminology before trying to bluff my way
through this one.
I hope I didn't confuse anyone else and didn't lose anyone in my obvious and
inexcusable blunder. I am so sorry folks.

>_is_ logically part of textual content, though you need to write it as an
>attribute value, due to an old mistake in the design of HTML.


You totally lost me by this time pal, I stopped reading your post after your
second insult. Go "help" someone that really needs it.

>
> --
> Jukka K. Korpela ("Yucca")
> http://www.cs.tut.fi/~jkorpela/



 
Reply With Quote
 
Jib
Guest
Posts: n/a
 
      09-16-2006

> Alternatively, you could use a server side language such as PHP or ASP
> to generate the tag depending on the language defined in
> HTTP_ACCEPT_LANGUAGE.
>
> Come back if this isn't clear!


Thanks, I 'll give the ASP option a try.


> Steve
> www.fontmadness.com
> "How much can one body take? The concrete shoes, the hungry lake"
>



 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-16-2006
Jib wrote:
> My site caters to different languages and the site has directories
> segregated by country, however some of my images are in shared folders. I
> can't (or shouldn't) use 'one language fit all' approach for my alt tags and
> the site structure is a bit complex to re-configuring it. I really want to
> use alt text, so is there any solution that anyone knows about that I can
> use? Maybe javascript mouse over which shows the appropriate text depending
> on which country the user is browsing?? I'm grasping here...
>
>

If you are hoping for the little 'tooltip' mouse over images, then you
are using the wrong attribute it should be the 'title' not the 'alt'.
The 'alt' is for when that image is not displayed (for text browser or
when images are disable or missing on the server) Only old MSIE and the
ancient Netscape 4.x incorrectly use the 'alt'.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      09-16-2006
Jib wrote:
> My site caters to different languages and the site has directories
> segregated by country, however some of my images are in shared folders. I
> can't (or shouldn't) use 'one language fit all' approach for my alt tags and
> the site structure is a bit complex to re-configuring it. I really want to
> use alt text


That's good, since alt tags don't exist (unless you define them in your
own DTD)!

, so is there any solution that anyone knows about that I can
> use? Maybe javascript mouse over which shows the appropriate text depending
> on which country the user is browsing?? I'm grasping here...


I don't understand--if you have a different page for each language, then
what's preventing you from also having a different value for a given
image's ALT attribute on each of them?
 
Reply With Quote
 
Dan
Guest
Posts: n/a
 
      09-16-2006

Jib wrote:
> Boy testy, aren't we? You are bordering on arrogance "Yucca".


Maybe he is... some of the "techie"-types on newsgroups like this tend
to a bit of snappiness in their style, but their advice is generally
sound nevertheless. You do need to remember that this is a discussion
group, not a free helpdesk.

Anyway, what he said is right. ALT attributes (not "tags") are part of
the HTML code along with the text content of the page, and are not part
of the image itself, and hence the fact that you store images in a
common subdirectory for use in multiple language versions of your site
is irrelevant to the possible use of different-language ALT text in the
HTML of the different versions.

More on languages on the Web:
http://webtips.dan.info/language.html

More on images and ALT attributes:
http://webtips.dan.info/images.html

--
Dan

 
Reply With Quote
 
Nikita the Spider
Guest
Posts: n/a
 
      09-16-2006
In article <byLOg.46$ht6.39@trndny06>, "Jib" <(E-Mail Removed)> wrote:

> My site caters to different languages and the site has directories
> segregated by country, however some of my images are in shared folders. I
> can't (or shouldn't) use 'one language fit all' approach for my alt tags and
> the site structure is a bit complex to re-configuring it. I really want to
> use alt text, so is there any solution that anyone knows about that I can
> use? Maybe javascript mouse over which shows the appropriate text depending
> on which country the user is browsing?? I'm grasping here...


Hi Jib,
You're already using some technique to serve content in different
languages. Why can't you apply the same technique to the <img> tags? So,
if you're using PHP or ASP to write your site's content from a database,
use the same to write the <img> tags with the value of the alt attribute
coming from the database, too. Or if you have static HTML files divided
into language-specific directories (/en/contact.html, /uk/contact.html,
/pl/contact.html, etc.) then use different alt tags in each.

Regardless of whether you're using one of my examples above or something
else, I don't see why the alt text is much different from the rest of
the HTML. But maybe I'm missing something.

BTW I'd steer clear of the Javascript solution. You'll penalize visitors
without JS turned on as well as search engines and other spiders.

HTH

--
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
alt.autos.porsche928,rec.humor.oracle.d,alt.balordi.it,alt.computer,sci.med.laboratory . Computer Information 1 06-18-2004 08:44 AM



Advertisments