SlideShare a Scribd company logo
Building Custom
CMS Applications
on WordPress
mitcho (Michael   貴 Erlewine)
THIS GUY    mitcho.com
DOWN HERE


            @themitcho
            slideshare.net/mitcho
CMS
There’s no such
thing as a CMS
success story.
The	
  Trouble	
  With	
  Back-­‐Ends
Erin	
  Griffith,	
  Adweek,	
  August	
  9,	
  2011
adweek.com/print/133917
CMS
it’s all about the C and M
FALSE
CC-BY-NC-SA flickr.com/photos/13382424@N00/5216424459/
Today:
1. Content
   C
2. Management
   M
1. Content
The essence of man is
discontent, divine discontent...

     the essence of web is
   content, divine content.




      José Ortega y Gasset
1. Content

    what     is the content?
             is the metadata?
   where     is the data?
Text?
That’s so 2000s.
Global Shakespeares
MIT Shakespeare Project
 globalshakespeares.org
Hundreds of productions with video
Document Revisions by Ben Balter
wordpress.org/extend/plugins/wp-document-revisions
pressfs by Joseph Scott
josephscott.org/pressfs-a-wordpress-filesystem
Build features
not post types
In development: Shakespeare scripts
Scripts are XML files, not content text in WordPress
                 No editor needed
CMS content
CMS content
Registering scripts

register_post_type('script', array(
	 'label' => 'Scripts',               instead of ‘editor’
	 'public' => true,
	 'hierarchical' => false,
	 'supports' => array('title', 'xmldoc', 'comments'),
	 'taxonomies' => array('post_tag')
));



    XML Documents with XSLT stylesheets
  wordpress.org/extend/plugins/xml-documents
Post Type Features
 post type                        features
              title, editor, author, thumbnail, excerpt, trackbacks,
    post        custom-fields, comments, revisions, post-formats

              title, editor, author, thumbnail, page-attributes,
   page               custom-fields, comments, revisions


 attachment                      comments

  default                      title, editor
Check for features


if if ( 'script' == $post_type
// ( 'script' == $post_type ) )
if ( post_type_supports( $post_type, 'xmldoc' ) )
Get meta.
Define your metadata.
metadata in WordPress


    {
  taxonomy
organizational
search, sorting
can be hierarchical
                         post meta
                        non-organizational
                        specific to the
                        content item
like tags, categories   like custom fields
CC BY-NC-SA flickr.com/photos/w3p706/2432014896/




http://ottopress.com/2011/when-
 to-not-use-a-custom-taxonomy/
Taxonomy Queries
query_posts( array(
   'post_type' => 'production',
   'tax_query' => array(
     array(
        'taxonomy' => 'play',
	      'terms' => array( 'hamlet' ),
	      'field' => 'slug'
     ),
     array(
        'taxonomy' => 'language',
	      'terms' => array( 'japanese', 'mandarin' ),
	      'field' => 'slug'
     )
   )
);
WordPress
is not an island
Edgerton Digital Collections
MIT Museum and MIT Edgerton Center
http://edgerton-digital-collections.org
12000 photos, 8000 notebook pages
All assets from the MIT Museum database
in MIMSY, a commercial collection management app
Edgerton

• Custom post type for museum assets
 • Specify ID, get image and metadata
     from museum DB
 •   Site-specific metadata (comments,
     tags) in WordPress
Remote data


• Hit external APIs with wp_remote_request()
    and friends
•   Cache results in Post Meta, Object Cache,
    Transients, as appropriate
Search integration


• Simple trick: put searchable text
    versions of custom content in
    post_content
•   Roll out a separate search
1. Content

    what     is the content?
             is the metadata?
   where     is the data?
2. Management
2. Management

   who   contributes/edits/
         curates/maintains it?
   how   will it be managed?
Who’s who?
Work for the weekend
add_filter( 'user_has_cap', 'workweek', 10, 3 );

function workweek( $allcaps, $caps, $args ) {
  $user = get_userdata( $args[1] );
  $weekend = ( date( 'N' ) > 5 );
  if ( $args[0] == 'publish_posts' &&
       $user->user_email = 'jane@automattic.com' &&
       $weekend )
    $allcaps['publish_posts'] = false;
  return $allcaps;
}
Keep It Simple,
Smartypants.
Shakespeare: rich metadata on each production
Production metadata consolidated into one meta box
Use add_meta_box(), intercept data with ‘save_post’ filter.
KISS

add_filter( 'default_hidden_meta_boxes',
   function( $hidden ) {
     $hidden[] = 'myboxid';
     $hidden[] = 'anotherboxid';
     //...
     return $hidden;
   }
);
The right tool (?)
for the job
Shakespeare: some video data
submitted by researchers in Excel format
Solution: a simple (custom) CSV file importer
Insert the post
$id = wp_insert_post( array(
  'post_title' => 'WP Hamlet',
  'post_status' => 'publish',
  'post_type' => 'production',
  'tax_input' => array(
     'play' => 'hamlet',
     'director' => 'matt-mullenweg',
     'language' => 'php' )
) );


Add post meta separately.
NING:
WA   R

• This is a balancing act
 • Moving to WordPress can be a great
     way to build new sustainable habits
 •   Not all traditions are constructive
what    is the content?
        is the metadata?
where   is the data?
who     contributes/edits/
        curates/maintains it?
how     will it be managed?
kick-ass CMS applications
Discontent is the first step in the progress of a man or nation...
   content is the first concern in the progress of a website.




Oscar Wilde
thank you.
                     Q?
mitcho (Michael       貴 Erlewine)
mitcho.com; @themitcho; slideshare.net/mitcho

More Related Content

PDF
bcgr3-jquery
PDF
Becoming a better WordPress Developer
KEY
Custom Post Types in Depth at WordCamp Montreal
PDF
jQuery: Nuts, Bolts and Bling
PDF
OOCSS for JavaScript Pirates jQcon Boston
PPT
jQuery Learning
PPTX
JavaScript!
PPT
How Not to Build a WordPress Plugin
bcgr3-jquery
Becoming a better WordPress Developer
Custom Post Types in Depth at WordCamp Montreal
jQuery: Nuts, Bolts and Bling
OOCSS for JavaScript Pirates jQcon Boston
jQuery Learning
JavaScript!
How Not to Build a WordPress Plugin

What's hot (20)

KEY
An introduction to jQuery
PPTX
jQuery Fundamentals
PDF
Drupal, meet Assetic
PDF
An Overview of HTML5 Storage
KEY
The jQuery Library
KEY
Introduction to jQuery - Barcamp London 9
PPTX
A Rich Web experience with jQuery, Ajax and .NET
PDF
jQuery in the [Aol.] Enterprise
PDF
State of jQuery and Drupal
PDF
Learning jQuery in 30 minutes
PDF
Introduction to jQuery (Ajax Exp 2007)
KEY
Bcblackpool jquery tips
PPT
jQuery and_drupal
PPTX
jQuery Best Practice
PDF
Geodaten & Drupal 7
PDF
So long, jQuery, and thanks for all the fish!
ZIP
Contextual jQuery
PPTX
A Rich Web Experience with jQuery, Ajax and .NET
PPTX
Auto tools
An introduction to jQuery
jQuery Fundamentals
Drupal, meet Assetic
An Overview of HTML5 Storage
The jQuery Library
Introduction to jQuery - Barcamp London 9
A Rich Web experience with jQuery, Ajax and .NET
jQuery in the [Aol.] Enterprise
State of jQuery and Drupal
Learning jQuery in 30 minutes
Introduction to jQuery (Ajax Exp 2007)
Bcblackpool jquery tips
jQuery and_drupal
jQuery Best Practice
Geodaten & Drupal 7
So long, jQuery, and thanks for all the fish!
Contextual jQuery
A Rich Web Experience with jQuery, Ajax and .NET
Auto tools
Ad

Viewers also liked (10)

PDF
Wykorzystanie możliwości ekranu personalizacji motywu - WordUp Łódź
PDF
check pdf preview
PDF
Ruby on Rails Tutorial
PDF
WordPress 4.0 - co nowego dla programistów?
PPTX
Code Igniter + Ext JS
PDF
Advanced Wordpress Queries
PDF
WordPress at Web Content Mavens (Jan. 2011)
PDF
Daj się wyręczyć
PPT
Brad Williams - Building Maritime Capabilities 2010
PPTX
Offical
Wykorzystanie możliwości ekranu personalizacji motywu - WordUp Łódź
check pdf preview
Ruby on Rails Tutorial
WordPress 4.0 - co nowego dla programistów?
Code Igniter + Ext JS
Advanced Wordpress Queries
WordPress at Web Content Mavens (Jan. 2011)
Daj się wyręczyć
Brad Williams - Building Maritime Capabilities 2010
Offical
Ad

Similar to CMS content (20)

PDF
Wordpress as a CMS
KEY
WordPress can do that?!
PDF
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
PPTX
The Flexibility of WordPress
PPTX
WordPress for developers - phpday 2011
PPTX
The 3Cs of WordPress
KEY
Using Custom Post Types & Taxonomies in WordPress
PDF
Content-Driven WordPress Development - WordCamp Omaha 2014
KEY
WordPress as a CMS (short version)
PPTX
Structured Data in WordPress
PDF
A Beginner's Guide to WordPress - WordCamp New York City 2012
PPTX
The WordPress University 2012
ZIP
WordPress as a CMS
KEY
Open Source CMS Playroom
PPT
Week 7 introduction to theme development
PPT
WordPress Complete Tutorial
PPTX
Custom Post Types - WordPress
KEY
Beginners' Guide to WordPress
KEY
A Beginner's Guide to WordPress - WordCamp Montreal 2012
PPTX
The WordPress University
Wordpress as a CMS
WordPress can do that?!
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
The Flexibility of WordPress
WordPress for developers - phpday 2011
The 3Cs of WordPress
Using Custom Post Types & Taxonomies in WordPress
Content-Driven WordPress Development - WordCamp Omaha 2014
WordPress as a CMS (short version)
Structured Data in WordPress
A Beginner's Guide to WordPress - WordCamp New York City 2012
The WordPress University 2012
WordPress as a CMS
Open Source CMS Playroom
Week 7 introduction to theme development
WordPress Complete Tutorial
Custom Post Types - WordPress
Beginners' Guide to WordPress
A Beginner's Guide to WordPress - WordCamp Montreal 2012
The WordPress University

More from iemail808 (11)

PPS
zprod2
PPS
PPS
PPS
PPS
PPS
PPS
PPS
PPS
pps images
PPT
my forrester
PDF
System recoverymanual multilanguage_v1.1
zprod2
pps images
my forrester
System recoverymanual multilanguage_v1.1

CMS content