Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The attached patch does a few things:
- Add a theme setting for skip link text, so people can easily customize without overriding html.tpl.php.
- Call it 'skip link' by default instead of 'jump link'. I believe skip link is a more recognisable term to have as a default, and the settings allow people to easily adjust the text into something like 'jump' if they want to.
- Use 'href' for the variable name instead of 'target'. I think target would kind of conflict with the target HTML attribute, and because the variable is only seen in the code (not in the UI), href might be more clear and suitable.
- Synchronize the variable descriptions in html.tpl.php with the ones for the UI a little bit.
- Add a link to http://drupal.org/node/467976 in the setting description, for people who really don't know what a skip link is yet.
What do you think of these?
Comment | File | Size | Author |
---|---|---|---|
#12 | skip-link-text-1154358-zen3.patch | 4.07 KB | JohnAlbin |
#11 | skip-link-text-1154358-11.patch | 4.65 KB | JohnAlbin |
#8 | zen-skip-link-settings-4.patch | 4.97 KB | maartenverbaarschot |
#5 | zen-skip-link-settings-3.patch | 4.97 KB | maartenverbaarschot |
#2 | zen-skip-link-template-1154358-2.patch | 1.22 KB | barraponto |
Comments
Comment #1
maartenverbaarschot CreditAttribution: maartenverbaarschot commentedMight want to include that link as a comment in the .info file too btw... I'll await feedback first.
Comment #2
barraponto CreditAttribution: barraponto commentedI guess it should be done in template.php, without touching the html.tpl.php file.
Comment #3
maartenverbaarschot CreditAttribution: maartenverbaarschot commentedl() is a nice addition.
Still I think it wouldn't make sense having to dig into template.php to just customize the link text when there's a setting for the href. They should be either both settings, or both in template.php.
Comment #4
barraponto CreditAttribution: barraponto commentedSure, let's merge the approaches and expose them in theme-settings.
Comment #5
maartenverbaarschot CreditAttribution: maartenverbaarschot commentedAdded $_GET['q'] as second parameter for l() and updated variable documentation in html.tpl.php.
Comment #6
maartenverbaarschot CreditAttribution: maartenverbaarschot commentedComment #7
KrisBulman CreditAttribution: KrisBulman commentednice addition! but patch fails for me
Comment #8
maartenverbaarschot CreditAttribution: maartenverbaarschot commentedRight… (Reminder to self: don't indent empty lines :))
Comment #9
KrisBulman CreditAttribution: KrisBulman commentedi can confirm that the patch does the trick, i applied it, created a new subtheme (via the new drush command).. checked and changed new theme settings, then verified changes through firebug (screenshot below)
https://skitch.com/krisbulman/fn1a8/local-dev-environment-drupal-7
Comment #10
KrisBulman CreditAttribution: KrisBulman commentedComment #11
JohnAlbinYou can't pass a variable into the t() function. It requires a string. The i18n module handles converting strings input via an admin form.
Given that, I don't really see the advantage of making the link a variable containing un-alterable HTML snippet.
I do, however, like the idea of making the link text a setting. How about we just print out the setting in the html.tpl.php like we do for the anchor link?
I've committed this patch for 7.x-5.x.
Comment #12
JohnAlbinWe can't rename the zen_jump_link_target variable in Zen 7.x-3.x, so I had to name the new variable to match that naming convention. :-\
Comment #13
JohnAlbin