SlideShare a Scribd company logo
Put a little
Backbone in
your
WordPress
http://tunedin.net/ • @roundearth • adam@10up.com
Put a little Backbone in your WordPress vs. 3
Backbone is Awesome
Philosophically, Backbone is an attempt to
discover the minimal set of data-
structuring (models and collections) and
user interface (views and URLs)
primitives that are generally useful when
building web applications with JavaScript
Should You Use Backbone?
☛ Prototypes: Views, Models, Collections.
☛ Plus: Events, Routes, History
☛ Data: bootstrapping & fetching
Backbone Basics
☛ Fast, interactive, responsive interfaces
☛ Organized code structure
☛ Lightweight
Why use Backbone?
☛ http://backbonejs.org/#examples
☛ Rdio, Hulu, Gawker, Foursquare, Disqus, Khan Academy,
Basecamp, Stripe, AirBnB, Pandora, Code School,
CloudApp, Trello and on and on…
☛ Backbone in WordPress core…
Some Examples
Backbone in WordPress Core
☛ media
☛ revisions
☛ themes
☛ what next?
☛ Collection functions: _.map, _.where, _.pluck, _.filter
☛ Timing functions: _.memoize, _.throttle, _.debounce,
_.once, _.delay, _.defer
☛ Utility: _.pick, _.extend, _.defaults
☛ http://underscorejs.org/
Underscore is Awesome
Underscore Examples
WordPress and Backbone
☛ WordPress JSON REST API
☛ wp_localize_script
☛ wp_ajax_(action)
☛ wp_create/verify_nonce
☛ wp_remote_get
☛ get/set_transient
☛ wp_send_json_success/error
☛ wp.template, wp.Backbone.view/subview
Coding Backbone is fun!
Coding Backbone is fun!
☛ annotated source code

backbonejs.org/docs/backbone.html
☛ simple and extendable - meant
to be flexible
☛ clean structure, templates, code
data binding
Considerations
☛ Accessibility
☛ nojs
☛ Internationalization
Building a Simple App
☛ DEMO 1
☛ Display a post
☛ Uses View, Model and Template
☛ Post data from the WP REST API
Template
Bootstrap Data
Post Model
JSON REST API
Post View
Initialization
Result
A bit more complex
☛ DEMO 2
☛ Display a post list using bootstrapped data, a
template and view
☛ Click post to load post via the WP REST API
☛ Uses Collection to handle all posts
☛ Uses same view from Demo1 for detail view
☛ Uses Router and History to handle routing
Template
Bootstrap Data
Post Collection
Post Collection View
Router
Initialization
Result
More complex
☛ Backbone driven plugin
to display user directory
☛ Grabs data by scraping
WordCamp attendee page
☛ Data stored in CPT,
passed via JSON REST
API
https://github.com/adamsilverstein/backbone-directory
Start Using Backbone
☛ Simple concepts
☛ Fast and lightweight
☛ Flexible and extendible
☛ Used in WordPress core
☛ Backbone - http://backbonejs.org/
☛ Underscore - http://underscorejs.org/
☛ Code School Backbone course - https://
www.codeschool.com/paths/javascript#backbone-js
☛ Developing Backbone Applications - https://
www.codeschool.com/paths/javascript#backbone-js
☛ JSON REST API - https://wordpress.org/plugins/json-
rest-api/ & https://github.com/WP-API/WP-API
☛ TLC Transients - github.com/markjaquith/WP-TLC-
Transients
☛ wp.Backbone.View/Subview - http://wordpress.tv/
2014/11/03/mark-jaquith-backbone-views-in-
wordpress/
☛ Demo Code: https://github.com/adamsilverstein/
backbone-demo
Resources
About
• Save assembly code onto cassettes
• Good at JavaScript & bug squashing
• Love contributing to WordPress Core
• WP Revisions Component Maintainer
• Managing Engineer at 10up
http://tunedin.net/ • @roundearth • adam@10up.com

More Related Content

PPTX
Web development using nodejs
PPTX
Introduction to JS frameworks
PDF
Bootstrap 3 Basic - Bangkok WordPress Meetup
ODP
Planning for CRAP and entity revisions in Drupal core
PPTX
Using multi-tenant WordPress to simplify development
ODP
Scout xss csrf_security_presentation_chicago
ODP
Content Staging in Drupal 8
ODP
Front-End Performance Optimizing
Web development using nodejs
Introduction to JS frameworks
Bootstrap 3 Basic - Bangkok WordPress Meetup
Planning for CRAP and entity revisions in Drupal core
Using multi-tenant WordPress to simplify development
Scout xss csrf_security_presentation_chicago
Content Staging in Drupal 8
Front-End Performance Optimizing

What's hot (20)

PPT
So You Want to Build and Release a Plugin? WordCamp Lancaster 2014
PDF
Taming 3rd party content
PDF
Beyond The Browser - Creating a RESTful Web Service With WordPress
KEY
Extending Custom Post Types
PPTX
Web scraping 101 with goutte
PPTX
An Introduction to Umbraco
PPT
Performance anti patterns in ajax applications
PPT
TSSJS2010 Presenatation on: Performance Anti Patterns In Ajax Applications
PPTX
Developing JavaScript Widgets
PPTX
Bower power
PDF
MongoDB and the MEAN Stack
PPTX
Html5 & less css
PDF
Performance on Rails
ODP
WS-* with WCF
PDF
Use Xdebug to profile PHP
PDF
JavaScript development methodology
KEY
doing_it_right() with WordPress
PPTX
Sitemaps
PDF
Sitemaps
PPTX
Introduction to Vue.js DevStaff Meetup 13.02
So You Want to Build and Release a Plugin? WordCamp Lancaster 2014
Taming 3rd party content
Beyond The Browser - Creating a RESTful Web Service With WordPress
Extending Custom Post Types
Web scraping 101 with goutte
An Introduction to Umbraco
Performance anti patterns in ajax applications
TSSJS2010 Presenatation on: Performance Anti Patterns In Ajax Applications
Developing JavaScript Widgets
Bower power
MongoDB and the MEAN Stack
Html5 & less css
Performance on Rails
WS-* with WCF
Use Xdebug to profile PHP
JavaScript development methodology
doing_it_right() with WordPress
Sitemaps
Sitemaps
Introduction to Vue.js DevStaff Meetup 13.02
Ad

Similar to Put a little Backbone in your WordPress vs. 3 (20)

PPTX
Put a little Backbone in your WordPress
PPT
Testable client side_mvc_apps_in_javascript
PDF
Front End Development for Back End Developers - vJUG24 2017
PPTX
Drupal Frontend Performance and Scalability
PPTX
Single Page Web Applications with WordPress REST API
PDF
The Server Side of Responsive Web Design
PDF
2.28.17 Introducing DSpace 7 Webinar Slides
PPTX
WordCamp Denmark Keynote
PDF
Front End Development for Back End Developers - Devoxx UK 2017
PDF
Front End Development for Back End Developers - UberConf 2017
PDF
Web Services
PPTX
Implementation of gui framework part2
PDF
Death of a Themer
PPT
Quick Start: ActiveScaffold
PDF
RESS: An Evolution of Responsive Web Design
PPTX
Boost and SEO
PPT
Open Source Web Technologies
KEY
Practical Use of MongoDB for Node.js
PDF
DrupalCampLA 2011 - Drupal frontend-optimizing
PDF
Headless approach for offloading heavy tasks in Magento
Put a little Backbone in your WordPress
Testable client side_mvc_apps_in_javascript
Front End Development for Back End Developers - vJUG24 2017
Drupal Frontend Performance and Scalability
Single Page Web Applications with WordPress REST API
The Server Side of Responsive Web Design
2.28.17 Introducing DSpace 7 Webinar Slides
WordCamp Denmark Keynote
Front End Development for Back End Developers - Devoxx UK 2017
Front End Development for Back End Developers - UberConf 2017
Web Services
Implementation of gui framework part2
Death of a Themer
Quick Start: ActiveScaffold
RESS: An Evolution of Responsive Web Design
Boost and SEO
Open Source Web Technologies
Practical Use of MongoDB for Node.js
DrupalCampLA 2011 - Drupal frontend-optimizing
Headless approach for offloading heavy tasks in Magento
Ad

Recently uploaded (20)

DOCX
Unit-3 cyber security network security of internet system
PPTX
SAP Ariba Sourcing PPT for learning material
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PPTX
innovation process that make everything different.pptx
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PPTX
Funds Management Learning Material for Beg
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PDF
Introduction to the IoT system, how the IoT system works
PDF
Sims 4 Historia para lo sims 4 para jugar
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PPTX
artificial intelligence overview of it and more
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
Unit-3 cyber security network security of internet system
SAP Ariba Sourcing PPT for learning material
RPKI Status Update, presented by Makito Lay at IDNOG 10
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
innovation process that make everything different.pptx
An introduction to the IFRS (ISSB) Stndards.pdf
Funds Management Learning Material for Beg
introduction about ICD -10 & ICD-11 ppt.pptx
Design_with_Watersergyerge45hrbgre4top (1).ppt
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
Introduction to the IoT system, how the IoT system works
Sims 4 Historia para lo sims 4 para jugar
PptxGenJS_Demo_Chart_20250317130215833.pptx
The New Creative Director: How AI Tools for Social Media Content Creation Are...
artificial intelligence overview of it and more
522797556-Unit-2-Temperature-measurement-1-1.pptx
Unit-1 introduction to cyber security discuss about how to secure a system
SASE Traffic Flow - ZTNA Connector-1.pdf
Tenda Login Guide: Access Your Router in 5 Easy Steps
Power Point - Lesson 3_2.pptx grad school presentation

Put a little Backbone in your WordPress vs. 3

  • 1. Put a little Backbone in your WordPress http://tunedin.net/ • @roundearth • adam@10up.com
  • 3. Backbone is Awesome Philosophically, Backbone is an attempt to discover the minimal set of data- structuring (models and collections) and user interface (views and URLs) primitives that are generally useful when building web applications with JavaScript
  • 4. Should You Use Backbone?
  • 5. ☛ Prototypes: Views, Models, Collections. ☛ Plus: Events, Routes, History ☛ Data: bootstrapping & fetching Backbone Basics
  • 6. ☛ Fast, interactive, responsive interfaces ☛ Organized code structure ☛ Lightweight Why use Backbone?
  • 7. ☛ http://backbonejs.org/#examples ☛ Rdio, Hulu, Gawker, Foursquare, Disqus, Khan Academy, Basecamp, Stripe, AirBnB, Pandora, Code School, CloudApp, Trello and on and on… ☛ Backbone in WordPress core… Some Examples
  • 8. Backbone in WordPress Core ☛ media ☛ revisions ☛ themes ☛ what next?
  • 9. ☛ Collection functions: _.map, _.where, _.pluck, _.filter ☛ Timing functions: _.memoize, _.throttle, _.debounce, _.once, _.delay, _.defer ☛ Utility: _.pick, _.extend, _.defaults ☛ http://underscorejs.org/ Underscore is Awesome
  • 11. WordPress and Backbone ☛ WordPress JSON REST API ☛ wp_localize_script ☛ wp_ajax_(action) ☛ wp_create/verify_nonce ☛ wp_remote_get ☛ get/set_transient ☛ wp_send_json_success/error ☛ wp.template, wp.Backbone.view/subview
  • 13. Coding Backbone is fun! ☛ annotated source code
 backbonejs.org/docs/backbone.html ☛ simple and extendable - meant to be flexible ☛ clean structure, templates, code data binding
  • 15. Building a Simple App ☛ DEMO 1 ☛ Display a post ☛ Uses View, Model and Template ☛ Post data from the WP REST API
  • 23. A bit more complex ☛ DEMO 2 ☛ Display a post list using bootstrapped data, a template and view ☛ Click post to load post via the WP REST API ☛ Uses Collection to handle all posts ☛ Uses same view from Demo1 for detail view ☛ Uses Router and History to handle routing
  • 31. More complex ☛ Backbone driven plugin to display user directory ☛ Grabs data by scraping WordCamp attendee page ☛ Data stored in CPT, passed via JSON REST API https://github.com/adamsilverstein/backbone-directory
  • 32. Start Using Backbone ☛ Simple concepts ☛ Fast and lightweight ☛ Flexible and extendible ☛ Used in WordPress core
  • 33. ☛ Backbone - http://backbonejs.org/ ☛ Underscore - http://underscorejs.org/ ☛ Code School Backbone course - https:// www.codeschool.com/paths/javascript#backbone-js ☛ Developing Backbone Applications - https:// www.codeschool.com/paths/javascript#backbone-js ☛ JSON REST API - https://wordpress.org/plugins/json- rest-api/ & https://github.com/WP-API/WP-API ☛ TLC Transients - github.com/markjaquith/WP-TLC- Transients ☛ wp.Backbone.View/Subview - http://wordpress.tv/ 2014/11/03/mark-jaquith-backbone-views-in- wordpress/ ☛ Demo Code: https://github.com/adamsilverstein/ backbone-demo Resources
  • 34. About • Save assembly code onto cassettes • Good at JavaScript & bug squashing • Love contributing to WordPress Core • WP Revisions Component Maintainer • Managing Engineer at 10up http://tunedin.net/ • @roundearth • adam@10up.com