Download - Consider the Content Life Cycle: WordPress CMS strategies and code

Transcript
Page 1: Consider the Content Life Cycle: WordPress CMS strategies and code

Consider the Content Life CycleWordPress CMS strategies and code

mitcho (Michael 芳貴 Erlewine)http://mitcho.com, @themitchoJune 4, 2011

Page 2: Consider the Content Life Cycle: WordPress CMS strategies and code

http://mitcho.com

@themitcho

Hi! I’m mitcho.

THIS GUY

Slides will be posted later on http://slideshare.net/mitcho

Page 3: Consider the Content Life Cycle: WordPress CMS strategies and code

WordPress as a CMS

• Easy to manage• A solid foundation• Faster development cycle• Cohesive structure and navigation• A great community• Plugins and themes you can use

Page 4: Consider the Content Life Cycle: WordPress CMS strategies and code

CONTENT

Page 5: Consider the Content Life Cycle: WordPress CMS strategies and code

CONTENT

CC-BY-NC-SA flickr.com/photos/bikeracer/6740232/

Page 6: Consider the Content Life Cycle: WordPress CMS strategies and code

who contributes/edits/curates/maintains it?

The Content Life Cycle

what

how

is the content?is the metadata?

will it be managed?where is the data?

Page 7: Consider the Content Life Cycle: WordPress CMS strategies and code

who

The Content Life Cycle

what

how

is the content?

where

Page 8: Consider the Content Life Cycle: WordPress CMS strategies and code

What is the content?

• What are they to you and your visitors?• Not just blog posts and pages...• People, events, locations, times...• What format are they?• Text? Documents? Images? Videos?• A particular data format?

Page 9: Consider the Content Life Cycle: WordPress CMS strategies and code

Global ShakespearesMIT Shakespeare Project

http://globalshakespeares.org

Page 10: Consider the Content Life Cycle: WordPress CMS strategies and code

Hundreds of productions with video

Page 11: Consider the Content Life Cycle: WordPress CMS strategies and code

In development: Shakespeare scripts

Page 12: Consider the Content Life Cycle: WordPress CMS strategies and code

• Productions and scripts are semantically distinct• Also have blog posts and pages• Custom Post Types!

Page 13: Consider the Content Life Cycle: WordPress CMS strategies and code

Custom Post Types

• WordPress comes with posts and pages• Internally, all called “posts”• Add other “post types”• register_post_type()

Page 14: Consider the Content Life Cycle: WordPress CMS strategies and code

Custom Post Types

register_post_type('production', array( 'label' => 'Productions', 'public' => true, 'hierarchical' => false, 'supports' => array('title', 'editor', 'comments'), 'taxonomies' => array('post_tag')));

More info at http://codex.wordpress.org/Post_Types

Page 15: Consider the Content Life Cycle: WordPress CMS strategies and code

Custom Post Types

• There are also plugins to administer and tweak custom post types• Plugins can also implement custom post types...

Page 16: Consider the Content Life Cycle: WordPress CMS strategies and code

Educational Collaboration SpaceMIT Dept. of Mathematics, NSF

http://ecs.mit.edu

Page 17: Consider the Content Life Cycle: WordPress CMS strategies and code

File Groupshttp://wordpress.org/extend/plugins/file-groups/

Page 18: Consider the Content Life Cycle: WordPress CMS strategies and code

File Groupshttp://wordpress.org/extend/plugins/file-groups/

Page 19: Consider the Content Life Cycle: WordPress CMS strategies and code

who

The Content Life Cycle

what

how

is the content?is the metadata?

where

Page 20: Consider the Content Life Cycle: WordPress CMS strategies and code

What is the metadata?

• Define your metadata• Aim for structured data• Structured data can be organized and reused neatly

Page 21: Consider the Content Life Cycle: WordPress CMS strategies and code

Rich metadata on each production

Page 22: Consider the Content Life Cycle: WordPress CMS strategies and code

Metadata in WordPress

• What do you want to group by?• This type of “organizational metadata”:• Custom taxonomies• Just like tags and categories for posts

Page 23: Consider the Content Life Cycle: WordPress CMS strategies and code

Custom Taxonomies

register_taxonomy( 'region', array('production','post'), array( 'hierarchical' => true, 'label' => 'Region', ) );

More info at http://codex.wordpress.org/Taxonomies

Page 24: Consider the Content Life Cycle: WordPress CMS strategies and code

Metadata in WordPress• Flags, properties not used for organization:• Postmeta! As seen in Custom Fields• “bits of information specific to the post item itself”

• Learn more at http://codex.wordpress.org/Custom_Fields• http://ottopress.com/2011/when-to-not-use-a-custom-taxonomy/

Page 25: Consider the Content Life Cycle: WordPress CMS strategies and code

who contributes/edits/curates/maintains it?

The Content Life Cycle

what

how

is the content?is the metadata?

where

Page 26: Consider the Content Life Cycle: WordPress CMS strategies and code

Consider your audience

• Your audience is not just your visitors!• Content management must be sustainable• Whose responsibility will it be?• What is their technical background?

Page 27: Consider the Content Life Cycle: WordPress CMS strategies and code

Permissions

• Who submits, publishes, edits?• Learn more: http://codex.wordpress.org/Roles_and_Capabilities• Can be customized via plugins or code• With Custom Post Types, can be controlled per-post-type.

Page 28: Consider the Content Life Cycle: WordPress CMS strategies and code

Content from visitors

• Visitors can contribute content too• Gravity Forms plugin lets you create forms and have submissions become posts or trigger other actions

Page 29: Consider the Content Life Cycle: WordPress CMS strategies and code

who contributes/edits/curates/maintains it?

The Content Life Cycle

what

how

is the content?is the metadata?

will it be managed?where

Page 30: Consider the Content Life Cycle: WordPress CMS strategies and code

The C and the M in CMS

• Think about that edit screen• Simplify and consolidate• Think about common admin tasks

Page 31: Consider the Content Life Cycle: WordPress CMS strategies and code

Rich metadata on each production

Page 32: Consider the Content Life Cycle: WordPress CMS strategies and code

Production metadata consolidated into one meta boxInfo: codex.wordpress.org/Function_Reference/add_meta_box

Page 33: Consider the Content Life Cycle: WordPress CMS strategies and code

Simplify, simplify, simplify

• Simplify the edit screen• You can hide things by default• Every meta box has an ID• It’s literally the id attribute...

Page 34: Consider the Content Life Cycle: WordPress CMS strategies and code

Simplify, simplify, simplify

add_filter( 'default_hidden_meta_boxes', 'hide_some_boxes' );

function hide_some_boxes( $hidden ) { $hidden[] = 'myboxid'; $hidden[] = 'anotherboxid'; //... return $hidden;}

Page 35: Consider the Content Life Cycle: WordPress CMS strategies and code

Simplify, simplify, simplify

New users will see less meta boxesBring them back from the Screen Options

Page 36: Consider the Content Life Cycle: WordPress CMS strategies and code

Support familiar tools (?)

• What tools are the maintainers used to?• How do they manage content now?• Can it be integrated into WordPress?

Page 37: Consider the Content Life Cycle: WordPress CMS strategies and code

Shakespeare: some video datasubmitted by researchers in Excel format

Page 38: Consider the Content Life Cycle: WordPress CMS strategies and code

Solution: a simple (custom) CSV file importer

Page 39: Consider the Content Life Cycle: WordPress CMS strategies and code

WARNING:

• This is a balancing act• Moving to WordPress can be a great way to build new sustainable habits• Not all traditions are constructive

Page 40: Consider the Content Life Cycle: WordPress CMS strategies and code

who contributes/edits/curates/maintains it?

The Content Life Cycle

what

how

is the content?is the metadata?

will it be managed?where is the data?

Page 41: Consider the Content Life Cycle: WordPress CMS strategies and code

WordPress-external data

• The core content data need not even be stored in WordPress proper• The benefits of WordPress: tags, categories, comments, etc. for free• But not without tradeoffs...

Page 42: Consider the Content Life Cycle: WordPress CMS strategies and code

Edgerton Digital CollectionsMIT Museum and MIT Edgerton Centerhttp://edgerton-digital-collections.org

Page 43: Consider the Content Life Cycle: WordPress CMS strategies and code

12000 photos, 8000 notebook pages

Page 44: Consider the Content Life Cycle: WordPress CMS strategies and code

All assets from the MIT Museum databasein MIMSY, a commercial collection management app

Page 45: Consider the Content Life Cycle: WordPress CMS strategies and code

External data sources

• MIMSY has a web API for data retrieval• Custom post type for museum assets• Specify ID, get image and metadata from museum DB live• Site-specific metadata (comments, tags) in WordPress

Page 46: Consider the Content Life Cycle: WordPress CMS strategies and code

In development: Shakespeare scripts

Page 47: Consider the Content Life Cycle: WordPress CMS strategies and code

Scripts are XML files, not content text in WordPressNo editor needed

Page 48: Consider the Content Life Cycle: WordPress CMS strategies and code
Page 49: Consider the Content Life Cycle: WordPress CMS strategies and code
Page 50: Consider the Content Life Cycle: WordPress CMS strategies and code

Registering scripts

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

XML Documents with XSLT stylesheetswordpress.org/extend/plugins/xml-documents/

instead of ‘editor’

Page 51: Consider the Content Life Cycle: WordPress CMS strategies and code

Data considerations

• Performance• XSLT rendering and external API calls are costly• Cache site of front-end• Sync content to WordPress?• Requires custom search integration

Page 52: Consider the Content Life Cycle: WordPress CMS strategies and code

Integrated search also uses external MIMSY DB API

Page 53: Consider the Content Life Cycle: WordPress CMS strategies and code

kick-ass CMS applications

Page 54: Consider the Content Life Cycle: WordPress CMS strategies and code

CONTENT

CC-BY-NC-SA flickr.com/photos/bikeracer/6740232/

Page 55: Consider the Content Life Cycle: WordPress CMS strategies and code

who contributes/edits/curates/maintains it?

The Content Life Cycle

what

how

is the content?is the metadata?

will it be managed?where is the data?

Page 56: Consider the Content Life Cycle: WordPress CMS strategies and code

Thank you!Questions?

Slides will be up on http://slideshare.net/mitcho

mitcho (Michael 芳貴 Erlewine)mitcho.com; @themitcho