Presentation from Daniel Tome on Building Responsive Websites with Drupal presented at DrupalGov Canberra 2013
http://drupalact.org.au/events/drupalgov-canberra-2013/conference/schedule
In the 45 minutes of the session these will be the topics that will be covered:
10 minutes – Overview of responsive design and why it is important
20 minutes – Methods of implementing it with Drupal. Explaining modules, themes and challenges
10 minutes – Keeping it accessible in the government sector
5 minutes – What things can be optimised and the future of RWD with Drupal 8
12. NATIVE APPS
Pros
– Available for offline use
– Provide a quick and smooth experience
– Access to device features (camera, etc)
Cons
– Expensive
– Limited platform support
– Hard to do well
– You still need a website
ALTERNATIVES
MOBILE SPECIFIC WEBSITE
Pros
̶ Optimised for speed easier
̶ Can target older devices
̶ No limitations for design
Cons
̶ Dealing with redirects
̶ Tablets usually are not targeted
̶ Tends to offer an incomplete experience
13. Pros
– Only need to maintain a single website
– No need for user agent detection
– No need for specific URL redirects
– Addresses multiple devices: phones, tablets, desktops, tv, etc
– Link sharing works the same for all devices
– Future ready
Cons
– Same content for all devices
– Cross browser and device incompatibilities
– Generally slower than m.dot website
– Testing time increased
RESPONSIVE WEB DESIGN
15. GENERALLY MOBILE USERS ARE ON THE
MOVEAND ARE GOING TO USE YOUR
SITE TO DO BASIC RESEARCH
“
” - lie
16. – The mobile user is on the move
– The mobile user is easily distracted
– The mobile user needs the information quickly
– The mobile user only wants to carry out one action
– The mobile user wants less content
MOBILE SCENARIOS
21. Omega
– https://drupal.org/project/omega
Bootstrap
– https://drupal.org/project/bootstrap
Adaptive
– https://drupal.org/project/adaptivetheme
Zen
– https://drupal.org/project/zen
Zurb
– https://drupal.org/project/zurb-foundation
MOST COMMON DRUPAL RWD THEMES
22. Fences
https://drupal.org/project/fences
Turn this:
<div class="field field-name-field-test field-type-text field-label-
above">
<div class="field-label">Foobar field: </div>
<div class="field-items">
<div class="field-item even">Leaner markup means better front-end
performance.</div>
</div>
</div>
Into This
<h3 class="field-label">Foobar field</h3>
<p class="field-foobar">Leaner markup means better front-end
performance.</p>
USEFUL MODULES
23. Do Nothing
– Just add padding
Select Menu
– Show menu in a <select> dropdown box
Toggle
– Small icon/toggle in header that displays the menu as a popup
Sidebar fly-out
– Similar to toggle, but allows longer menu structure. (made popular by facebook)
MENU LAYOUTS
26. Allow access to table outside of theme. Eg: Dowload
Alternatives with JS
Demo: http://zurb.com/playground/projects/responsive-tables/index.html
TABLES
27. Be careful with viewport zooming
Use the grid system
Custom selectors on media queries need to be applied on multiple breakpoints
ORIENTATION CHANGES
29. RESPONSIVE WEB DESIGN AND
ACCESSIBILITYARE VERY COMPLEMENTARY,
BUT … DOING RESPONSIVE DESIGN DOES
NOT MEAN THAT YOUAUTOMATICALLY HAVE
ANACCESSIBLE SITEAND VICE VERSA.
“
”- Baruch Sachs
30. Viewport should be allowed to be zoomed 200%
Focus order is still important
Colour contrast between background and
foreground needs to be greater than desktop
MOBILEACCESSIBILITY
31. Scrollbars needed when content does not fit viewport
Must respond correctly to removal of CSS
Should be readable without specific colours
Position and reading order must remain the same
Instead of hiding content with CSS, use DOM manipulation
DESKTOPACCESSIBILITY WITH RWD
33. Yepnope library
– http://yepnopejs.com/
Lazy loading
Adaptive images
– https://drupal.org/project/adaptive_image
– https://drupal.org/project/picture Used in Drupal 8 core backported to D7
LOADING WHAT YOU NEED
35. Strategy for the Mobile Initiative
https://groups.drupal.org/node/207248
John Albin
DRUPAL 8 MOBILE INITIATIVE
Editor's Notes
A definition of responsive according to wikipedia is:If you thought this session is about improving the speed of your website in a positive manner, then you’re in the wrong session..
How often have you heard mobile site usage described along the following lines:
mobile user needs are often based on over-simplified scenarios:While some of these scenarios are often not far from the truth, there is still a prevalent trend for mobile users to be grouped together.Are these assumptions born out the behavior of mobile users, or is their behaviour a product of the poor experiences that are offered to them?
“85% of users expect a mobile site to offer an experience better than or equal to a desktop computer.”
Most things come down to these options:Dropping content downHide certain content that does not work on mobile
The aim of this theme is to show new themers how a few lines of CSS can adapt an existing theme to be "responsive". The CSS applied in the theme make radical visual changes to the original design to emphasize what's happening at each of the "break" points for the content-based media queries. The CSS as written is not appropriate for real Web sites, but acts as a good starting point for people wanting to retrofit their own sites to be responsive.
Do nothing. Height of menu will take up a lot of screenSelect menu. Pros: smaller height. Cons.. Hard to show children and larger menus. JS dependent)
Alpha release because it hasn’t added all the API features from wooThemesflexslider.It IS stable
How often have you heard mobile site usage described along the following lines:
Using CSS to hide content in different contexts may not always provide the desired results with assistive technology. Manipulation of the DOM to add or remove page content should be used (e.gappendChild).
Yepnope: example. Don’t need parallax on mobile. Then don’t load parallax library. The Adaptive image module provides device-appropriate versions of images from your fields.You can activate adaptive images by adding an adaptive effect to any of your image styles.
Drupal 8 Core is responsive out of the box.(as seen on Dave’s earlier talk)