1 / 37

Parent / Child Data Modeling

Parent / Child Data Modeling. Dennis Solis. Solis Media Group Over 20 years of application software development. 3 years of Drupal development Mentor: Drupal Career Starter Program Presented a multiple Drupal Camps d.o . : densolis irc : # drupal-florida skype: densolis.aol.com. 2.

mbaughman
Télécharger la présentation

Parent / Child Data Modeling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Parent / Child Data Modeling

  2. Dennis Solis Solis Media Group Over 20 years of application software development. 3 years of Drupal development Mentor: Drupal Career Starter Program Presented a multiple Drupal Camps d.o. : densolis irc: #drupal-florida skype: densolis.aol.com 2

  3. Dennis Solis Born and raised in SF

  4. Dennis Solis Living in Cocoa, Fl Born and raised in SF

  5. What is Parent ChildData Modeling? Example 1 – Edit Event

  6. What is Parent ChildData Modeling A “different” way of looking at your data. Visualize how content is related Relate a node to a node No code and no custom entities

  7. How is Parent ChildData Modeling Different? • Drupal normal approach is: • Independent content types • Taxonomies • And maybe entity references. • Use of the content list • Not really user friendly

  8. Why change? Provides a more “natural” UI Add a dashboard, which provide easy UI No longer use the content list! No code and no custom entities

  9. PC RelationshipsModules Entity Apientity Entity Reference entityreference Entity Connect entityconnect View views Entity Ref Views Widget entityreference_view_widget Auto Entity Label auto_entitylabel

  10. Drupal Camp PC Data Model What data do we need for a Drupal Camp?

  11. Drupal Camp Data Model • News • Rooms • Sessions • Session Speakers • Event type • Event • Venue • Time slots • Sponsors • Featured Speakers • Description What data do we need for a Drupal Camp?

  12. Drupal Camp Data Model 12 Content types / taxonomies Traditional approach – 12 different menus What is the training curve for a end user?

  13. Drupal Content for DC Event Drupal Camp Sponsors Featured Speakers News Venue Users / Speakers Sessions Schedule Time Slots Rooms

  14. Drupal Camp Data Model • New employee – first day on the job, you ask them to enter the Drupal camp schedule. • They have to go to multiple menu options and enter the • Time slots • Rooms • Experience level • And the associate Sessions and Speaker with the time slot / room.

  15. DC Parent Child Data Model The PCDM looks at these items very different. This approach is VERY USER CENTRIC Users can access everything from 1 main form! Reduces user training because the data entry process is intuitive. And views run very fast because everything is direct access.

  16. DC Parent Child Data Model Event Drupal Camp

  17. DC Parent Child Data Model Event Drupal Camp News Venue Schedule Featured Speakers Time Slots Sponsors

  18. DC Parent Child Data Model Event Drupal Camp News Venue Schedule Featured Speakers Time Slots Sponsors Users / Speakers

  19. DC Parent Child Data Model Event Drupal Camp News Venue Schedule Featured Speakers Time Slots Sponsors Rooms Users / Speakers Sessions

  20. DC Parent Child Data Model Event Drupal Camp News Venue Schedule Featured Speakers Time Slots Sponsors Rooms Users / Speakers Sessions

  21. Simple UI Everything, except creation of sessions, is accessed from the Event. You only need on menu option for the Event! Simplify it even more that creating a dashboard that is automatically presented at login.

  22. Content Types • Create your content from the bottom up. • Lowest content in the parent child relation ship first. • Have the parent reference the child using entity relationship. • We will “connect” the different content types using: • Entity Connect • Entity view widgets

  23. 3 Parts to aRelationship Create relationship using entity reference in your content types. Use entity connect to put edit / add icons on your page. Use views to display the related data.

  24. Step 1Create Entity Reference • Example 2 • Edit the structure of the Event • Admin -> Structure -> Content Type -> Manage Field -> Event • Look at the Venue field

  25. Step 2Entity Connect • Example 2 • Edit the structure of the Event • Admin -> Structure -> Content Type -> Manage Field -> Event • Look at the Venue field

  26. Step 3 Views - Add relationships • Views – Add relationship • Referenced • Read child from the parent or • Down from parent to child • Referencing • Read the parent from the chileor • Up to Parent from the child

  27. Step 3 Views - Add relationships • Example 3 – View DC Sessions • Referenced – Read entity referenced from source • View is based upon Event and reading Session’s Date / Time, Title, and Presenters

  28. Step 3 Views - Add relationships • Example 4 – View Event Sessions • Referenced – Read entity referenced from source • View is based upon Event Contextual Filter and reading Session’s Date / Time, Title, and Presenters

  29. Views conditionals module: views_conditional You want to check some condition before you decided to the field should be displayed. In my case, I check a person’s role before decide if they have the permissions to see a specific field. Example

  30. ViewsAdd relationships • Views – Add relationship (Example 4) • Referenced – Read entity referenced from source. (Down from parent to child) • View is based upon Customer Order and reading Staff, and Dish information • Referencing – Read up to source from entity reference. (Up from child to parent) • View is based upon Staff and reading Customer Order information.

  31. Univ. of Hard Knocks Suggestions for Views • Include node type in field name • Easily find field in views list of fields.

  32. UHK Suggestions for Views Name content types in singular Names views in plural If you name content type and view the same, then views hangs

  33. UHK Suggestions for Views • If using multiple views: • “All displays” vs “this page” • Structure -> Views -> Settings • Show the SQL query

  34. UHK Suggestions for Views Make input required BEFORE views runs.

  35. UHK Suggestions for Views • Page views with same path. • Bad – only one view will appear in the menu • Good – if the different views have different role permission, you can have multiple views under one menu item – and role appropriate view will appear.

  36. UHK Suggestions for Views Don’t forget to put in No Results message in your view.

  37. Congratulation! You are now an Parent Child Expert!

More Related