Click here to register.
      
PBWG Banner


     Discuss > WebGUI Templates Working Group

Graceful degredation

User patspam
Date 9/25/2008 1:55 am
Views 724
Rating 0    Rate [
|
]
Previous · Next
User Message
patspam
patspam
Hi guys,

Some food for thought..

The current default Navigation menu is rendered dynamically by YUI from WebGUI-generated html markup. This is great because it means we can do graceful degredation for people without Javascript (and also makes the nav links available for SEO).

However if you view the default WG site (attachment: nav-js.png) with Javascript turned off, you will see that the navigation links look pretty aweful (attachment: nav-broken.png). It's pretty easy to fix though (attachment: nav-noscript.png), just edit the navigation template as follows:
  1. Add an extra class called something like "noscript" to the webguinavigation div
    <div id="webguinavigation" class="yuimenubar noscript">
  2. Add an extra line to the javascript which will automatically remove this class for js-enabled viewers:
    YAHOO.util.Dom.removeClass('webguinavigation', 'noscript');
  3. Add some extra CSS targetting the noscript class to make things look nicer for non-js viewers:
    #webguinavigation.noscript {
        background: none; /* hide normal background */
    }
    #webguinavigation.noscript li {
        display: inline; /* display on single line */
        margin-right: 5px;
    }
    #webguinavigation.noscript li div {
        display: none; /* hide sub-menus */
    }
It would be nice to apply this sort of approach in general to templates so that sites degrade nicely. I'm sure someone can suggest a better name than "noscript" for the class too :)

Patrick


Attached Files
Back to Top
Rate [
|
]
 
 
rogier
rogier

It would be nice to apply this sort of approach in general to templates so that sites degrade nicely. I'm sure someone can suggest a better name than "noscript" for the class too :)

Patrick

Let's think about javascript in the context of the templates in general. Graceful degradation is ofcourse a requirement as well as unobtrusiveness. There are a couple of places where this might be an issue:

  • YUI navigation
  • The CS post templates Arjan is talking about here
  • The gallery slideshow (I think? - haven't checked out the gallery yet)
  • ...

Lets make an inventory: do we know any other places where js can be found? Is it:

  • degrading gracefully?
  • unobtrusive?
  • ...any other requirements?

I'm no js expert so I'll need some help with this.

 

Rogier | United Knowledge
www.unitedknowledge.nl · www.webgui-help.nl



Back to Top
Rate [
|
]
 
 

Recent Discussions Color Key

Design:

Development:

Et Cetera:

Install/Upgrade:  

Smoketest:

Template Group:


Re: Navigation links by rogier - Fri @ 04:06pm

Re: Navigation links by techwriter - Fri @ 03:23pm

Re: Best way to make files available to webgui comunity by bernd - Fri @ 02:50pm

Re: User event history by knowmad - Fri @ 02:02pm

Re: Best way to make files available to webgui comunity by lctn2 - Fri @ 01:55pm

Re: Strategic Roadmap by JT - Fri @ 01:55pm

Re: Navigation links by rogier - Fri @ 01:55pm

Re: 2009 Presidents Meeting by JT - Fri @ 01:10pm

Re: navigation new window by rogier - Fri @ 01:03pm

Re: navigation new window by rogier - Fri @ 12:53pm

Re: WUC 2009 by JT - Fri @ 12:50pm

Re: Best way to make files available to webgui comunity by preaction - Fri @ 12:35pm

Re: Pagination markup by rogier - Fri @ 12:35pm

Re: Best way to make files available to webgui comunity by kristi - Fri @ 12:29pm