1 / 38

Wrapping Views around your fingers

Wrapping Views around your fingers. Dennis Solis. Solis Media Group Over 20 years of application software development. 2 years of Drupal development Assisting with D8 Migration in core d.o . : densolis irc : # drupal-florida & # drupal -migrate: densolis skype: densolis.aol.com. 2.

rbrady
Download Presentation

Wrapping Views around your fingers

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. Wrapping Views around your fingers

  2. Dennis Solis Solis Media Group Over 20 years of application software development. 2 years of Drupal development Assisting with D8 Migration in core d.o. : densolis irc: #drupal-florida & # drupal-migrate: densolis skype: densolis.aol.com 2

  3. Views TopicsModules Contextual Filter views, ctools Relationshipentity entity reference entity connect Views Relationship views, ctools

  4. Views If Time TopicsModules Views conditional views_conditional Download views_data_export

  5. You are all experts in Contextual filters Relationships

  6. What is a contextual filter? Basically a contextual filter is simply a way of limiting what information you displayed to the user.

  7. Why? Help your users focus on items for which they are search. Limit what data the user see.

  8. How could you possible be a CONTEXTUAL FILTER expert?

  9. Contextual Filter

  10. Contextual Filter

  11. Contextual Filter

  12. Contextual Filter

  13. Contextual Filter Examples Courses on a restaurant’s menu Bad Camp sessions Airline reservations Filter by product types on Amazon or E-Bay

  14. Contextual FiltersSamples • Restaurant Menu (Example 1) • Menu at a glance – show everything • Starters • Signature Appetizers • Main Entrees • Jack Daniel’s Grill • Sour and Salads

  15. Contextual Filters Let’s examine the restaurant’s contextual filter (Example 2)

  16. How could you possible be a RELATIONSHIP expert?

  17. Relationships Because of the relationship, you know some things about the other person.

  18. What is a relationships? Content User Author’s Name Content type (taxonomy) Image • Menu category • Starters • Appetizers

  19. Why? You want to maintain a single copy / instance of your data. Your web site reference the single copy / instance of your data. If you change the data, it is changed through out the web site.

  20. Relationships Author / user create a content node An image is associated with a content node A taxonomy term associated with a content node Another entity associated with a content node

  21. How do you create arelationship? Kind of like setting up a taxonomy entry. Remember, an entity references another entity! Setup a content type of Waiter / staff Setup a content type of menu dish On the Customer Order, we will “connect” the customer order to both the Waiter / staff and menu dish content types.

  22. Relationships (Example 3 & 4) CT - Menu section CT – Staff

  23. Relationships (Example 5) CT – Dishes CT - Menu section CT – Staff

  24. Relationships (Example 6) CT – Customer Order CT – Dishes CT - Menu section CT – Staff

  25. Relationships (Example 7) CT – Customer Survey CT – Customer Order CT – Menu Item CT - Menu section CT – Wait staff

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

  27. Relationship Examples • Display an customer order (Example 8) • Restaurant customer order relationships: • Waiter / staff • Item order reference menu dish

  28. Relationship / SQL View • INNER JOIN: • Returns all rows when there is at least one match in BOTH tables. • Require relationship = Y • LEFT JOIN: • Return all rows from the left table, and the matched rows from the right table. • Require relationship = N

  29. ViewsAdd relationships • Views – Add relationship (Example 8) • Referenced – Read entity referenced from source • View is based upon Customer Order and reading Staff, and Dish information • Referencing – Read source from entity reference • View is based upon Staff and reading Customer Order information.

  30. Download a table into a CSV file modules: views_data_export The module view data export will allow you to download your table view into a comma separated value (CSV) file.

  31. Download a table into a CSV file (Example 9) Data export is exposed on your view

  32. Download a table into a CSV file (Example 10) Choose “Data Export” from the +Add in views Notice your Format is CSV File

  33. Download a table into a CSV file • You can put replacement patterns in the file name • Setting • The text “by deselection this, the xml file…” is a bit misleading. • Need to check “Provide as file” if you want a download file!

  34. Download a table into a CSV file • Make sure you specify: • A path • I used <view_path>_dnld • Attach to – The view to attach the download. • Batch export – Yes if big download • Pager = Display all items

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

  36. UHK Suggestions for Views • Name content types in singular • Names views in plural • If using multiple views: • “All displays” vs “this page” • Structure -> Views -> Settings • Show the SQL query • Make input required BEFORE views runs.

  37. 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. • With views aggregation – do not sort the data. Let the aggregation do it. • Don’t forget to put in No Results message in your view.

  38. Congratulation! You are now an Advance Views builder!

More Related