Presentation is loading. Please wait.

Presentation is loading. Please wait.

Parent / Child Data Modeling 1. 2 Dennis Solis Solis Media Group Solis Media Group Over 20 years of application software development. Over 20 years of.

Similar presentations


Presentation on theme: "Parent / Child Data Modeling 1. 2 Dennis Solis Solis Media Group Solis Media Group Over 20 years of application software development. Over 20 years of."— Presentation transcript:

1 Parent / Child Data Modeling 1

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

3 Dennis Solis Born and raised in SF 3

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

5 What is Parent Child Data Modeling? Example 1 – Edit Event 5

6 What is Parent Child Data 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 6

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

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 8

9 PC Relationships Modules Entity Apientity Entity Referenceentityreference Entity Connectentityconnect Viewviews Entity Ref Views Widgetentityreference_view_widget Auto Entity Labelauto_entitylabel 9

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

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

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

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

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

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

16 DC Parent Child Data Model 16 Event Drupal Camp

17 DC Parent Child Data Model 17 Event Drupal Camp News Featured Speakers Sponsors Time Slots VenueSchedule

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

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

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

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. 21

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 22

23 3 Parts to a Relationship 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. 23

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

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

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 chile or Up to Parent from the child 26

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 27

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 28

29 Views conditionals module: views_conditional 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 Example 29

30 Views Add 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. 30

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

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

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

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

35 UHK Suggestions for Views Page views with same path. Page views with same path. Bad – only one view will appear in the menu 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. Good – if the different views have different role permission, you can have multiple views under one menu item – and role appropriate view will appear. 35

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

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


Download ppt "Parent / Child Data Modeling 1. 2 Dennis Solis Solis Media Group Solis Media Group Over 20 years of application software development. Over 20 years of."

Similar presentations


Ads by Google