<?php if ($logo): ?>
<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
<img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
</a>
<?php endif; ?>
This is a logo represent your website, brand..etc. When it can't show normally, it should tell us this is a LOGO of this website (Your website name or slogan). Logo is not the HOME, the wrapper LINK is link to homepage that is HOME.
The alt attribute specifies alternate text that is rendered when the image cannot be displayed
http://www.w3.org/TR/REC-html40/struct/objects.html#edef-IMG
Comment | File | Size | Author |
---|---|---|---|
#19 | bartik_logo_alt-2.patch | 620 bytes | mgifford |
bartik_logo_alt.patch | 553 bytes | droplet | |
Comments
Comment #2
droplet CreditAttribution: droplet commentedMissed there hasn't $site_name_and_slogan on bartik. Seeks for feedback first, I will patch it again later.
Comment #3
oriol_e9gwhy not?
or
Comment #4
Everett Zufelt CreditAttribution: Everett Zufelt commentedSee: #717708: Document how to set logo in theme with proper alt tags for ability to set custom alt on logo.
This is a string change and I am not in support of backporting to 7.x
The purpose of the alt attribute on an image is to provide an alternative textual replacement for an image, for when the image is not available. It becomes more tricky to provide an appropriate alt when the image is also a link, as most AT will only read the alt, and not the alt + link title. I am pretty comfortable with leaving this as 'Home', but am open to suggestions of other strings.
I think that site-name site-slogan is a bit verbose, and doesn't cover the purpose of the link, to take the user to the 'Home' page of the site.
Comment #5
droplet CreditAttribution: droplet commentedWhat's the main purpose of this? ("LOGO & LINK")
Show a "website logo" or a "back home" link ??
I think websites Logo never tell users: BACK TO HOME (Visitors only know it's a logo of the website, no one use an image with "HOME" text to be site logo). Disabled images. It's same.
Whatever you hover the link, it will tell you this is a "Home Link" (A tag's title)
It's also a SEO problem.
Comment #6
dcmouyard CreditAttribution: dcmouyard commentedI personally use a blank alt attribute for the logo in my themes, but I don't use the logo as a link. In fact, I don't even display the logo unless someone prints the page.
Since Drupal core and most themes use the logo as a link to the home page, I think the alt attribute should describe where the link is pointing to. Anything along the lines of 'Home,' 'Home page,' or 'Back to home' sound reasonable to me.
Comment #7
jherencia CreditAttribution: jherencia commentedComment #8
droplet CreditAttribution: droplet commentedYour logo is "Drupal", a link point to "Drupal", it's alright. Always better than "back home" on LOGO, less side effect.
Remove link on Logo isn't a good practice.
Comment #9
Everett Zufelt CreditAttribution: Everett Zufelt commentedI posted a message to the WebAIM discussion list, let's see if we get any useful feedback.
http://webaim.org/discussion/mail_message?id=18547
Comment #10
dcmouyard CreditAttribution: dcmouyard commentedWhy is removing the link around the logo not good practice if the logo is never displayed, except for printing purposes?
Comment #11
droplet CreditAttribution: droplet commentedGenerally, websites have link around the Logo and it will link back to home. Users assumed it on all websites. Have you ever think about where the LOGO is linking to.. ?
It's code on default Bartik theme too. It still link back to your website home but never use "back to HOME". I think no one disagreed this one. Why you don't disagree it ??
in Drupal case, all default theme & installation have a HOME link (text is HOME). No Home text on Logo & Title don't means you will lost the way. But now, you DON't KNOW that image is the website logo.
Comment #12
mgiffordMostly subscribing & hoping to help simplify this piece of D8.
Comment #13
dcmouyard CreditAttribution: dcmouyard commented@droplet - Just to clarify, I completely agree that the logo, if displayed on the screen, should link to the home page. In my themes, however, I only display the logo when a user prints the page.
As far as the alt attribute text goes, it seems like using either some form of 'Home' or the site's name is acceptable, since they both describe where the link is pointing to. Because there seems to be a SEO benefit to using the site's name, that's my vote.
Comment #14
droplet CreditAttribution: droplet commented@dcmouyard,
You can use a media-specific stylesheet for print. :)
Sounds like replies from #9 mail list are support to use Site name as LOGO alt.
Our W3C WAI:
WebAIM:
Comment #15
Everett Zufelt CreditAttribution: Everett Zufelt commentedOkay, let's go with $site_name. I'll roll a patch.
Comment #16
oriol_e9gComment #17
Everett Zufelt CreditAttribution: Everett Zufelt commentedPostponing on #717708: Document how to set logo in theme with proper alt tags
Comment #18
andrewmacpherson CreditAttribution: andrewmacpherson commentedsubscribing, because of #717708: Document how to set logo in theme with proper alt tags
Comment #19
mgiffordNoting that Bartik is the only theme at the moment that has this issue. Not sure what the next core theme will be, but...
Figured I'd update the patch here. Hopefully we get a resolution about the custom logo issue above.
Comment #20
BarisW CreditAttribution: BarisW commentedI'm not sure if we can only print the $site_name_and_slogan. In the WAI and W3C cases, the logo reads the site name, so then it makes sense to just let it be the site name. But when a logo doesn't contain text , it should say something like 'Logo of Site Name'.
For example, see whitehouse.gov:
<img src="/sites/default/themes/whitehouse/img/clear.gif" alt="The White House Emblem" title="" width="1" height="1">
Our company is focussed on accessibility; for our sites we always tend to do this:
<a href="/" title="Back to the homepage"><img src="logo.png" width="200" height="100" alt="Logo of Site Name" title="Site Name - Site Slogan" /></a>
The ALT tag should describe the image, the title can give more info like the slogan, right?
Comment #21
mgiffordThis patch has been bundled up into #717708: Document how to set logo in theme with proper alt tags with the following code for bartik:
Your proposing that it be something like this by default:
I don't know if any AT will see the title on the image under the title on the link. Titles haven't been well used on images in the past, so we've generally defaulted to simply using alt for images and title for text (if we want the tooltip on hover).
Anyways, this should probably be moved over to the other issue. Just wanted to clarify this here.