rich storytelling with drupal, paragraphs and islandora dams (drupalcamp brighton)

54
Rich web stories With Paragraphs and Islandora DAMS Alex Bridge / Tassos Koutlas

Upload: cogapp

Post on 17-Jul-2015

645 views

Category:

Internet


1 download

TRANSCRIPT

Page 1: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Rich web storiesWith Paragraphs and Islandora DAMS

Alex Bridge / Tassos Koutlas

Page 3: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

OverviewAbout the projectDrupal and Islandora DAMSCreate rich web storiesDiscussion

Page 4: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Baseball Hall of Fame

Serves as the central point for the study of the history of baseball in theUnited States and beyond.

Page 5: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Stats last monthPageviews: ~ 765,000Sessions: ~ 305,000Active users: ~ 250,000

Page 6: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Cogapp development9 content types93 template files (.tpl.php)647 taxonomy terms45 contrib modules9 custom modules19 features

Page 7: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Project scopePresent the vast archive of content BHoF has, create connections that bring

data to life and drive user engagement.

Page 8: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

DAMS

Page 9: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

What is a DAMS?Digital Asset Management SystemUsed for long­term storage and management of digital assetsManages metadata associated with these assets

Page 10: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Popular DAMSFree/Open source

DSpaceResourceSpaceFedora Commons...

ProprietaryPictionWebDAMBynder...

Page 11: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Fedora CommonsBest­of­breed object repository for storing, managing, and accessingdigital contentWell­thought­out structures for long­term storageJava/Tomcat­based

Page 12: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Fedora featurescontent is managed as data objects, represented using XMLallows complex relationships between data objectseach object contains a number of datastreamsprovides ability for virtual datastreams or behaviors of the object

Page 13: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Why not just use Fedora?

Very technical to administrateRequires a lot of customisation

Page 14: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

IslandoraNot a stand­alone software packageFedora Commons backendSuite of Drupal modules providing:

management interface to Fedoracommon data typesimport/export capabilitiesvarious other features

Page 15: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Islandora featuresProvides solution packs meeting common needsMetadata supportArchival­specific features

Page 16: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Islandora features (contd.)REST APIFaceted search and browse (Solr)Ability to sync content to Drupal nodes

Page 17: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Whylandora?Single system for managing archival & web contentArchival content stored in best­of­breed system/format, even if websitemoves from Drupal in future (other front­ends to Fedora are available)Multiple ways to integrate DAMS content with web

Page 18: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)
Page 19: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)
Page 20: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Web integrationOpen DAMS as read­only to webIslandora Sync to nodesReference Islandora objects in Drupal

Approach chosen for Baseball Hall of Fame siteUsed   module to deliver images from FedoraImagecache External

Page 21: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Getting started with IslandoraSandbox

Virtual machine image

Chef cookbook

Manual install

http://sandbox.islandora.ca/

http://alpha.library.yorku.ca/releases/7.x­1.4/Islandora_7x­14.ova

https://github.com/ryersonlibrary/islandora_chef

https://wiki.duraspace.org/display/ISLANDORA714/Chapter+8+­++Installing+Islandora

Page 22: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Rich web stories

Page 23: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Rich web storiesThree main components contribute to the methodology we have developed:

A way to deliver content (paragraphs)A way to integrate content (entity references)A way to present content (entity view modes)

Page 24: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Deliver content with ParagraphsA new way to deliver contentNo WYSIWYG editor to create content inCreate paragraph types and define any fields in them (they are entities)Paragraph types can be anything from a simple piece of text to a complexassortment of fieldsSo how are they used?

Page 25: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Step 1Add paragraph field to the content type

Page 26: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Step 2Create paragraph bundles (paragraph types)

Page 27: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Step 3Add a paragraph type to your content

Page 28: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Step 4Add content

Page 29: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Step 5Review result

Page 30: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

What do we get out of using itAn extendable content areaComplex content with paragraph typesDrag and drop functionalityEasily create structural parts of the page (eg. subtitles, promotions, etc)Bring together diverse content within the CMSFiner control over html output

Page 31: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Paragraph templatesAbility to control markup within the node (every paragraph bundle gets a

different template).<node> <!-- paragraphs-item--para-text.tpl.php --> <paragraph_item>TEXT</paragraph_item>

<!--paragraphs-item--para-subtitle.tpl.php --> <paragraph_item>RELATED HALL OF FAMERS</paragraph_item>

<!-- paragraphs-item--para-hof.tpl.php --> <paragraph_item>HALL OF FAMERS WIDGET</paragraph_item>

<!-- paragraphs-item--para-promos.tpl.php --> <paragraph_item>PROMO</paragraph_item></node>

Page 32: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Paragraphs vs Field collectionsParagraphs have multiple bundles (types)Paragraph bundles are accessible through the interfaceDifferent types in a single paragraph fieldParagraph types are exportable with features

Page 33: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Integrate content with entityreferencesWhat we were aiming at:

Reach content regardless of source (images vs dams_assets)Support onward user journeys (reach other content)Support social media sharing (assets and content)

Page 34: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Preprocessing per node typefunction nbbhof_preprocess_node(&$variables) { ... // Create preprocess functions per content type. $function = __FUNCTION__ . '_' . $node->type; if (function_exists($function)) { $function($variables); }}

function nbbhof_preprocess_node_hof_dams_asset(&$variables) {

// Code that is specific to this content type }

Page 35: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

It enables usTo have finer control on content (eg. create inline table of contents)To interchangably use locally hosted images and DAMS assets

as hero imagesas sidebar imagesas full size images on contentas slideshows

To create different twitter cards based on typeTo integrate other sources of content from the CMS

Page 36: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)
Page 37: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)
Page 38: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)
Page 39: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)
Page 40: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Paragraphs and entity referencesTwo types of Paragraph types

Paragraph types that contain entity referencesParagraph types that contain other fields (textfields, etc)

Page 41: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

So farWe have an extensible way to reach and deliver content through

paragraphs.Wouldn't it be nice to control how referenced content is presented in the

same way we control paragraph types?

Page 42: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

What we have so far<node> <paragraph_item>TEXT</paragraph_item> <!-- we have templates for this --> <paragraph_item>RELATED HALL OF FAMERS</paragraph_item> <!-- and this -->

<paragraph_item> <!-- what about these? --> <referenced_entity>HALL OF FAMER</referenced_entity> <referenced_entity>HALL OF FAMER</referenced_entity> <referenced_entity>HALL OF FAMER</referenced_entity> </paragraph_item>

<paragraph_item> <!-- or this? --> <referenced_entity>PROMO</referenced_entity> </paragraph_item></node>

Page 43: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Present content with entity viewmodes

View modes provide entities with a mechanism to select which fields todisplay and a way to display them through templates.

Page 44: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Enabling view modesA simple function call in D7 (through the interface in D8).

function bhof_view_modes_entity_info_alter(&$entity_info) { // Create a paragraph view mode. $entity_info['node']['view modes']['paragraph'] = array( 'label' => t('Paragraph'), 'custom settings' => TRUE, ); ...}

Page 45: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Availability on content type

Page 46: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Result

Page 47: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Use on paragraph type

Page 48: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Use on paragraph type

Page 49: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Use on paragraph type

Page 50: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Use on paragraph type

Page 51: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Now<node> <paragraph_item>TEXT</paragraph_item> <!-- we have templates for this --> <paragraph_item>RELATED HALL OF FAMERS</paragraph_item> <!-- and this -->

<paragraph_item> <!-- node--hof--paragraph.tpl.php for each --> <referenced_entity>HALL OF FAMER</referenced_entity> <referenced_entity>HALL OF FAMER</referenced_entity> <referenced_entity>HALL OF FAMER</referenced_entity> </paragraph_item>

<paragraph_item> <!-- node--hof-promo--paragraph.tpl.php --> <referenced_entity>PROMO</referenced_entity> </paragraph_item></node>

Page 52: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Why do we use themEach view mode has its own display fieldsEach view mode has its own template fileApply logic depending on the view mode (slideshows, full images, etc)Front­end work with templates rather than drupal theming system

Page 53: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

DiscussionParagraphs provide an extensible model to deliver contentEntity references in paragraphs allows us to bridge content (incl. DAMSassets)Entity view modes provide finer control over markup

Page 54: Rich storytelling with Drupal, Paragraphs and Islandora DAMS (DrupalCamp Brighton)

Questions?