Going Mobile First With Drupal
Upcoming SlideShare
Loading in...5
×
 

Going Mobile First With Drupal

on

  • 7,071 views

Building Drupal sites mobile first with lazy loading, responsive media and Varnish - without driving anyone insane. ...

Building Drupal sites mobile first with lazy loading, responsive media and Varnish - without driving anyone insane.

A combined session, technical overview, and outlined solution.

Includes the notes from the workshop at the end.

Statistics

Views

Total Views
7,071
Views on SlideShare
5,608
Embed Views
1,463

Actions

Likes
14
Downloads
102
Comments
0

11 Embeds 1,463

http://frontendunited.org 1286
http://www.drupalsoul.com 99
http://lanyrd.com 40
http://www.linkedin.com 10
https://twitter.com 10
http://fro1-001.dev.atomicant.co.uk 9
http://dev.frontendunited.org 4
http://drupalsoul.com 2
http://www.sylvainlasnier.fr 1
http://us-w1.rockmelt.com 1
https://www.linkedin.com 1
More...

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Going Mobile First With Drupal Going Mobile First With Drupal Presentation Transcript

  • Going mobilefirst with Drupal
  • This session
  • This is a workshop.You will do the <del>hard</del> interesting work, not me.
  • About meJesper Wøldiche RahkonenMunicipality of Aarhusdesigner /markup marine /project lead /woeldiche on twitter / quora / linkedin / etc.
  • About you.
  • Slides available online.
  • Overview0: RWD A quick peak at RWD1: Mobile First What and why mobile first?.2: Challenges Lazy loading, images, resources.3: Requirements Requirements for a solution.4: Solution Outline of a Drupal solution.
  • Part 0: RWD
  • This workshop
  • This workshopMobile first in a responsive web designcontext.
  • This workshopMobile first in a responsive web designcontext.Mobile first does not necessitateresponsive web design.
  • This workshopMobile first in a responsive web designcontext.Mobile first does not necessitateresponsive web design.Alternatives later.
  • Aim for universal access.
  • Make no assumptions.Or try not to.That goes for accesibility too.
  • Design and build foreverything in between.
  • Design and build foreverything in between.Including the next device.
  • Case: Lancaster U.
  • Wide screen
  • Narrow
  • Tablet sized
  • Smartphone
  • Why use RWD?
  • BenefitsReduced costs for multiple platforms.
  • BenefitsReduced costs for multiple platforms.Sustainable.
  • BenefitsReduced costs for multiple platforms.Sustainable.Future proof.
  • BenefitsReduced costs for multiple platforms.Sustainable.Future proof.Works on iPhone 5.
  • rs le d 5 d o e eT v n lo ho iP
  • RWD solves challenges.One article = one url.
  • RWD solves challenges.One article = one url.Update content once.
  • RWD solves challenges.One article = one url.Update content once.Maintain one platform only.
  • SD
  • 34% more buzzwords perproject.Nah, not really.But your boss loves it anyway.
  • How?
  • A combination of techniquesand web standards
  • Responsive webdesignFlexible grids
  • Responsive webdesignFlexible grids+ media queries
  • Responsive webdesignFlexible grids+ media queries+ adaptive media
  • Responsive webdesignFlexible grids+ media queries+ adaptive media+ web standards
  • “But hestarted it...”
  • Adaptive webdesign?Fluid or fixed columns doesn’tmake a difference for a mobilefirst approach.
  • Part I: Why Mobile First?
  • Overview: Part IWhat What is mobile first?WhyAlternatives
  • Overview: Part IWhatWhy The benefits of mobile first.Alternatives
  • Overview: Part IWhatWhyAlternatives A look at alternatives.
  • What is mobile first?
  • “Designing for mobile first not onlyprepares you for the explosive growthand new opportunities on the mobileinternet, it forces you to focus andenables you to innovate in ways youpreviously couldn’t.” - Luke Wroblewski
  • The traditional way
  • The traditional wayDesign/build a desktop version
  • The traditional wayDesign/build a desktop versionPort things to mobile - maybe.
  • The traditional wayDesign/build a desktop versionPort things to mobile - maybe.Or ‘responsive’. Hide content - after loading it.
  • Mobile first design
  • Mobile first isa design method.But not the focus of today’ssession.
  • Mobile first ties intoresponsive web design.And device experiences,RESS and desktop-only.
  • A development process
  • A development processDesign mobile version first.
  • A development processDesign mobile version first.Even if you are not planning on doing a mobile.
  • A development processDesign mobile version first.Even if you are not planning on doing a mobile.Build and build on top of mobile.
  • A development processDesign mobile version first.Even if you are not planning on doing a mobile.Build and build on top of mobile.Add & adapt content going up.
  • Design the mobile versionfirst. Even if you don’t planon building it.
  • Benefits
  • Benefits of mobile firstGrowthCreative contraintsPerformanceNew capabilities
  • Mobile is exploding.
  • Mobile is personal.
  • SD
  • Mobile providesconstraints.You know those are a goodthing, right?
  • Small screenenforcesfocus.
  • Small screenenforcesfocus.Allows you to prioritize.
  • Constraintsinspire creativitity.
  • SD
  • Enforce performanceconciousness.
  • Enforce performanceconciousness.Benefits all platforms.(if done correctly)
  • Advanced capabilities
  • Advanced capabilitiesLocation
  • Advanced capabilitiesLocationDevice orientation
  • Advanced capabilitiesLocationDevice orientationCameras
  • Advanced capabilitiesLocationDevice orientationCamerasTouch
  • Alternatives
  • Alternatives.To responsive web design.But mobile first regardless :-)
  • Part III: Challenges
  • Overview: Part IIPerformanceThe challengeAdaptive mediaAproaches
  • It’s about performance.
  • ‘Performance test of 347responsive web sites (in 2012!)reveals absolute train wreck ofmobile-last, display:none“strategies”.’ - Stephanie Rieger
  • ‘Only 3% of responsive sites had amuch smaller performance footprinton small screens than on large screens#bdconf’ - Brad Frost, @bradfrost
  • The performant mobile siteSmaller images, lower bandwidth media
  • The performant mobile siteSmaller images, lower bandwidth mediaFewer graphics
  • The performant mobile siteSmaller images, lower bandwidth mediaFewer graphicsProgressive loading of JS and resources.
  • The performant mobile siteSmaller images, lower bandwidth mediaFewer graphicsProgressive loading of JS and resources.Less content up front (progressive disclosure)
  • The performant mobile siteSmaller images, lower bandwidth mediaFewer graphicsProgressive loading of JS and resources.Less content up front (progressive disclosure)Sensible defaults
  • The Challenge
  • Progressively enhance(transform?) a performantmobile website into a fullsize, full experience large-screen website.
  • Two (three) issuesLazy, asynchronous loading of contentand resources.
  • Two (three) issuesLazy, asynchronous loading of contentand resources.Adaptive images and media.
  • Two (three) issuesLazy, asynchronous loading of contentand resources.Adaptive images and media.Modular, progressive loading of resources.
  • Lazy loading
  • Let’s talk lazy loading.
  • Serve core content as HTML
  • Load in additional contentwith js as dimensions,context and capabilitiesdictate.
  • Use well defined,streamlined, extendablepatterns.For defining and loadingadditional content.
  • Bonus:With only one request
  • Adaptive media
  • Lots of existing solutions.Some of them good.
  • A few Drupal modulesdrupal.org/project/responsive_imagesdrupal.org/project/resp_imgdrupal.org/project/adaptive_imagedrupal.org/project/aisdrupal.org/project/cs_adaptive_image
  • Part III: Requirements
  • Requirements gatheredin workshop.Thanks for contributing.Slide on...
  • ChoicesDrupal 7 unpatched core.Must work with Varnish, CDNs.Works well with anonymous users.
  • Requirements for solutionLoad regions based on mediaquery.Cacheable for anymous users.Attempt reduce number of bootstrapsServe core content as HTMLConfigurableReusableEach region targetable with URL.
  • Part IV: Solutions
  • An outline for general,configurable Drupal 7 solutionfor lazy loading.
  • The four componentsConfiguration and admin interface.Template files.Client-side JS.JSON response from server.
  • An extendablecontrib module.One admin page.Rewrites page output.Sends JSON output based onURL parameters.
  • Configuration component.Define named presets for layouts (eg. ‘narrow’,‘normal’, ‘mobile’).
  • Configuration component.Define named presets for layouts (eg. ‘narrow’,‘normal’, ‘mobile’).Select core region(s). Output as HTML.
  • Configuration component.Define named presets for layouts (eg. ‘narrow’,‘normal’, ‘mobile’).Select core region(s). Output as HTML.Select additional, js-loaded regions foreach preset.
  • Configuration component.Define named presets for layouts (eg. ‘narrow’,‘normal’, ‘mobile’).Select core region(s). Output as HTML.Select additional, js-loaded regions foreach preset.Define media queries for each preset (width,height for starters).
  • Template componentpage.tpl.php includes <?php print $region; ?>for all regions as normal.
  • Template componentpage.tpl.php includes <?php print $region; ?> forall regions as normal.Conditionally set [‘#access’] = FALSE; foroptional regions based on query-string in URLin hook_page_alter().
  • Template componentpage.tpl.php includes <?php print $region; ?> forall regions as normal.Conditionally set [‘#access’] = FALSE; foroptional regions based on query-string in URL inhook_page_alter().Output optionally include a link to full version.
  • SD
  • Server-side componentAdds an admin page (see above).
  • Server-side componentAdds an admin page (see above).Returns optional regions as JSON in 1 request.
  • Server-side componentAdds an admin page (see above).Returns optional regions as JSON in 1 request.Based on appended “responsive=true”& preset (eg. preset=narrow).
  • Server-side componentAdds an admin page (see above).Returns optional regions as JSON in 1 request.Based on appended “responsive=true”& preset (eg. preset=narrow).Or renders optional regions as HTML on‘responsive=false&preset=desktop’ (for testing).
  • Server-side component 2Module grab all required regions, return as a jsonarray using drupal_json_output()
  • Server-side component 2Module grab all required regions, return as a jsonarray using drupal_json_output()Include information about target (#siderbar-right)to JSON.
  • Server-side component 2Module grab all required regions, return as a jsonarray using drupal_json_output()Include information about target (#siderbar-right)to JSON.Return page with all regions using query
  • SD
  • Client-side componentClient-side JS loaded on page-load.
  • Client-side componentClient-side JS loaded on page-load.First page load includes lists of presets andmediaqueries in drupal.settings.
  • Client-side componentClient-side JS loaded on page-load.First page load includes lists of presets andmediaqueries in drupal.settings.JS requests additional content and includesrelevant preset and URL.
  • Client-side componentClient-side JS loaded on page-load.First page load includes lists of presets andmediaqueries in drupal.settings.JS requests additional content and includesrelevant preset and URL.Server sends additional regions as JSON -including information on targets.
  • Client-side componentClient-side JS loaded on page-load.First page load includes lists of presets andmediaqueries in drupal.settings.JS requests additional content and includesrelevant preset and URL.Server sends additional regions as JSON -including information on targets.JS inserts region content from JSON into DOM.
  • You don’t need notesBaggrundMålsætningerStrategiLøsningsforslag
  • More sources‘Responsive Webdesign’, Ethan Marcotte.‘Mobile First’, Luke Wroblewski.‘A New Canon’, Mark Boulton.‘Reponsible Responsive Images’, Jeremy Keith.‘Responsive IMGs’, Jason Grigsby.Links online.
  • Thank you.slideshare.net/woeldiche
  • Responsive web designLinkshttp://www.abookapart.com/products/responsive-web-designhttp://www.alistapart.com/articles/responsive-web-design/http://www.zeldman.com/2011/07/06/responsive-design-i-dont-think-that-word-means-what-you-think-it-means/
  • Mobile firstLinkshttp://www.lukew.com/ff/entry.asp?933http://www.lukew.com/ff/entry.asp?1137http://www.lukew.com/ff/entry.asp?1393http://www.abookapart.com/products/mobile-first
  • A New CanonLinkshttp://2011.newadventuresconf.com/audio/mark.htmlhttp://vimeo.com/29991675http://www.netmagazine.com/interviews/in-depth/mark-boulton-layouts-and-grid-systems
  • Responsive ImagesLinkshttp://adactio.com/journal/4997/http://blog.cloudfour.com/responsive-imgs/http://blog.cloudfour.com/responsive-imgs-part-2/http://blog.cloudfour.com/responsive-imgs-part-3-future-of-the-img-tag/http://www.alistapart.com/articles/responsive-images-how-they-almost-worked-and-what-we-need/