drupal & dungeons & dragons
DESCRIPTION
This session was an exploration of complex real-world data management issues, and ways to solve them, using D&D as a point of reference for discussion. The presentation was given by Tobby Hagler, Senior Developer at Phase2 Technology at DrupalCamp Atlanta.TRANSCRIPT
![Page 1: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/1.jpg)
Solving Real-World Data Management
Problems
![Page 2: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/2.jpg)
Tobby HaglerSenior Developer
![Page 3: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/3.jpg)
What doesDungeons &
Dragons have to do with Drupal?
![Page 4: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/4.jpg)
Drupal & D&DReal-world data complexity issues
Difficult workflows to manage and codify
Contrib modules – scratch your own itch
![Page 5: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/5.jpg)
D&D Character Module
Complicated forms and character management
Levels, classes, races, feats, skills, weapons, and equipiment – All have unique
properties
No D7 D&D Character sheet module…
![Page 6: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/6.jpg)
D&D Characterand Learning Drupal 7Learning something new with a familiar subject
Solving a “real” need
Features module and Fields API
![Page 7: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/7.jpg)
Learn a new language
“Hello World”
Manipulate user inputDisplay and manipulate input
D&D character generator
![Page 8: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/8.jpg)
![Page 9: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/9.jpg)
D&D DataManagement
PC Information•Race: Special abilities, bonuses and penalties, feats•Class: Extra skills and feats, spells, or limitations•Skills: Cross-class, ranks•Feats: Prerequisites, bonus feats•Attributes: Saves, Initiative, base attack, misc. bonuses
Other Details•Spells: Components, spellcraft feats•Equipment: special attributes, magical abilities, masterwork•Animal Companions: HD, spell-like abilities, morale•NPCs: Abilities, backstory•Campaign Notes: History, geography
![Page 10: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/10.jpg)
Data ManagementProblems to
SolveLots of fieldsManaging fields
Compound Fields
Data OutputPrintable Output
![Page 11: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/11.jpg)
Nodes andStandard Fields
Standard Fields•Name: string•Race: string•Class: string•Attributes: integer, bonuses?•Skills: integer, strings•Feats: string, checkboxes•Weapons: ??
Bonuses and Attributes•Name: fine•Race: fine, but affects things like attribute values•Class: different levels for multiclass•Skills: class vs cross-class (half)•Feats: manage prerequisites•Weapons: damage, speed, crit range – compound fields
![Page 12: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/12.jpg)
Standard FieldsAren't EnoughRegardless of the data type
Fields are always name:value pairs
Fields can contain multiple valuesBut not multiple keys
![Page 13: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/13.jpg)
Multiple Values
![Page 14: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/14.jpg)
Multiple
ValuesVerticalbut not
Horizontaldata depth
![Page 15: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/15.jpg)
D&D FieldsCompanion module to D&D Character
Drupal 7 Fields API
![Page 16: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/16.jpg)
Abilities
Multiple valuesnot enough
Names of eachability score
Multi-dimensional or compound values
![Page 17: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/17.jpg)
Compound
FieldsEach field can have different
widgets
Custom fields for different data types
![Page 18: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/18.jpg)
Fields API in3 Easy Steps
Tell Drupal about the field and schemahook_field_infohook_field_schemahook_field_validatehook_field_is_empty
User Inputhook_field_widget_infohook_field_widget_form
Outputhook_field_formatter_infohook_field_formatter_view
![Page 19: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/19.jpg)
![Page 20: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/20.jpg)
Field Widgets
Armor widget is bothhorizontal and vertical
![Page 21: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/21.jpg)
Field Formatters
![Page 22: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/22.jpg)
Field FormatersMay Not Be Enough
Node templates can workFine for on-screen display
Printing forms for recordsHTML and CSS don’t make great
printouts
![Page 23: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/23.jpg)
D&D Character Sheet
What web output works for print?
PDF is the universalonline print document
![Page 24: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/24.jpg)
PC Record Sheets
Storing data is one thingPrintable character record
sheets is key
![Page 25: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/25.jpg)
Drupal andPDF Output
Node templates generate HTML
Can be styled with CSS and HTML
Print module is closestDoesn’t come nearly close enough
![Page 26: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/26.jpg)
![Page 27: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/27.jpg)
![Page 28: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/28.jpg)
Node Data In PDF
![Page 29: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/29.jpg)
Drupal as a Campaign Manager
![Page 30: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/30.jpg)
CMS: Campaign Management System
Blog Pages for previous runs
Standard Pages for NPCs or historical background
Custom content types for artifacts, animal companions, and kingdoms
![Page 31: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/31.jpg)
![Page 32: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/32.jpg)
SummaryFields API for building compound fields
PDF for specific records
Drupal as a CMS manages extra data
![Page 33: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/33.jpg)
Resourcesagileapproach.com/blog-entry/compound-fields-
drupal-7
drupal.org/project/dnd_character
api.drupal.org/api/examples/field_example--field_example.module/function/
field_example_field_info/7
![Page 34: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/34.jpg)
Questions?
![Page 35: Drupal & Dungeons & Dragons](https://reader035.vdocuments.site/reader035/viewer/2022081715/548da230b479599d2d8b45bb/html5/thumbnails/35.jpg)
Contactthagler@phase2technology
@phase2tech
d.o: tobby
Slides: AgileApproach.com