Views Mini-Course, Part I: An Introduction to Views

2,514 views
2,504 views

Published on

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,514
On SlideShare
0
From Embeds
0
Number of Embeds
956
Actions
Shares
0
Downloads
53
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Views Mini-Course, Part I: An Introduction to Views

  1. 1. Part 1!Views mini-courseacquia.com1Wednesday, May 8, 2013
  2. 2. Heather JamesManager of Training at AcquiaHELLO!@learningdrupal@hjames2Wednesday, May 8, 2013
  3. 3. Acquia Traininghttp://training.acquia.com3Wednesday, May 8, 2013
  4. 4. Course materials• Tested in hundreds ofclassrooms.• Continuously updated.• Clear and easy follow, butengaging content.• Blend of guided andchallenge exercises totest skills.http://training.acquia.com/coursesThe materials /handouts were verycomprehensive -personally I would notchange anything.- O.G. Jan 20124Wednesday, May 8, 2013
  5. 5. The trainers are partners• Our trainers areexperienced developerswho love teaching.• They provide subjectmatter expertise as wellas well as passion for thetopic.• Partners are placed allover the globe.http://training.acquia.com/testimonialsLovely presenter, verypatient and open toquestions. I feel a lotmore confident to usedrupal myself andunderstand thetechnicalunderpinnings.- C.L., Sept 20125Wednesday, May 8, 2013
  6. 6. • On site training for teams, pre-course assessment andpersonalized training programsTailored courses availablehttp://training.acquia.com/coursesTRAINING@ACQUIA.COM6Wednesday, May 8, 2013
  7. 7. The first class!!• Viws mini course- May 2nd: Introduction to Views < -- you are here- May 8th: How to build flexible views- May 15th: Build your first module to back up your views!• Drupal essentials- May 22nd: Drupal Essentials: How to Configure Accounts in Drupal• Drupal for Project Managers mini-course- May 29th-June 19th: 4 weeks - Drupal for Project Managers!Adam Boysen, Jakub Suchy, Amye Scavarda, Jenn Sramek7Wednesday, May 8, 2013
  8. 8. Views mini course!• How to expose data across your site.• Create lists of content, users, terms.• Tables, lists, galleries, slideshows, whoah!8Wednesday, May 8, 2013
  9. 9. What weʼre doing today• Today: the very basics.• Whatʼs the point?• How Views works - What it does• General orientation and terminology.• Enough to be dangerous!9Wednesday, May 8, 2013
  10. 10. What you need to know already!• How to add content• How to customize content types (add fields)• What modules are• How to install and configure modules10Wednesday, May 8, 2013
  11. 11. Where are you at?New toDrupalExperiencedwith DrupalWhat the heckis Views??I can make viewswith one handbehind my back11Wednesday, May 8, 2013
  12. 12. VIEWS!12Wednesday, May 8, 2013
  13. 13. What you may be thinkingexample.com newsaboutmastheadpoliticssportscontactYour mentalsite map13Wednesday, May 8, 2013
  14. 14. A mental hurdleexample.com newsaboutmastheadpoliticssportscontactYour mentalsite mapNews headlineson sidebar ofcontact page?14Wednesday, May 8, 2013
  15. 15. Drupal holds dataArticlesUsersComments““TermsNot everything you see is “content”15Wednesday, May 8, 2013
  16. 16. Demo: Add a viewA quick magic trick!16Wednesday, May 8, 2013
  17. 17. Demo! Your front page• What does Drupal do out of the box?• Override the front page• Add a new view listing specific type ofcontent.17Wednesday, May 8, 2013
  18. 18. Potentially confusing• Displaying “content” withView mode options• Displaying “fields” withper-field settings18Wednesday, May 8, 2013
  19. 19. Query builder• Click to create queries with Views.• Filters to limit selection can be static orcontextual.• You can see the actual query written.19Wednesday, May 8, 2013
  20. 20. WHY DO WE HAVEVIEWS?You’re gonna love this20Wednesday, May 8, 2013
  21. 21. Example: Jane Pickens Theatrejanepickens.com21Wednesday, May 8, 2013
  22. 22. This shows “content”I am a node!22Wednesday, May 8, 2013
  23. 23. Landing page23Wednesday, May 8, 2013
  24. 24. Your perfect workflow?24Wednesday, May 8, 2013
  25. 25. Develop perfect markup!25Wednesday, May 8, 2013
  26. 26. The old days!• <?php// Connecting, selecting database$link = mysql_connect(mysql_host, mysql_user, mysql_password)or die(Could not connect: . mysql_error());echo Connected successfully;mysql_select_db(my_database) or die(Could not select database);// Performing SQL query$query = SELECT * FROM my_table;$result = mysql_query($query) or die(Query failed: . mysql_error());// Printing results in HTMLecho "<table>n";while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {echo "t<tr>n";foreach ($line as $col_value) {echo "tt<td>$col_value</td>n";}echo "t</tr>n";}echo "</table>n";// Free resultsetmysql_free_result($result);// Closing connectionmysql_close($link);?>• // Printing results in HTMLecho "<table>n";while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {echo "t<tr>n";foreach ($line as $col_value) {echo "tt<td>$col_value</td>n";}echo "t</tr>n";}echo "</table>n";26Wednesday, May 8, 2013
  27. 27. Example: Expression engineAlter queryAlter markupAdd logicWhat if client wants changes?27Wednesday, May 8, 2013
  28. 28. Views is a query builderChoose base tableChange typesTerm filtersSimple sort28Wednesday, May 8, 2013
  29. 29. http://drupal.org/community-initiatives/drupal-core29Wednesday, May 8, 2013
  30. 30. Example: Events• Control which usergroups can addevents.- Easy date selection?- Display “calendar”page?- Sidebar block showingevents?• Where do you look?UntitledBy hydropeekAttribution 2.0 Generic (CC BY 2.0)30Wednesday, May 8, 2013
  31. 31. • Drupal 5 or 6- All-in-one solution.• Drupal 7 +- More generic, flexible.- Don’t duplicate effort.- Standardizeadministration.- Less dependence oncustom code.PreviousDrupal 7Create + display eventsDisplay calendar or listingCreate "event content type"Event moduleContent typesand Field (core)Date fieldCalendar Views+31Wednesday, May 8, 2013
  32. 32. Date entry field• Date module storescontent in dateformate.• “Date popup” forentering in dates hasseveral options.32Wednesday, May 8, 2013
  33. 33. Modules format display• Calendar or FullCalendar• Display formats ortemplates33Wednesday, May 8, 2013
  34. 34. The Drupal Way!"#$%&#()*+, -&#*.#*, /)01(+, 2+&"*, 311.4#$.,!"#$%&#()*+, -&#*.#*, /00.1#$.,DrupalOther systemsA big fancymiddle man34Wednesday, May 8, 2013
  35. 35. Typical Drupal website0 25.00 50.00 75.00 100.00Core and contrib Custom codeLesscustomisbetterThroughsitebuildingand configuration** Based on a survey of Drupal executives in the CXO event, Belgium, 2011.35Wednesday, May 8, 2013
  36. 36. Say what?• A CMS makes it easy for a “lay person” toupdate content on a site without a developer.• Drupal takes this one step further and putsdeveloper tools within their reach.• Any questions at this point?36Wednesday, May 8, 2013
  37. 37. FINDING YOUR WAYAROUNDWelcome to Views37Wednesday, May 8, 2013
  38. 38. Views wizardPage or blockDisplay settingsAdd to menuhttp://www.flickr.com/photos/fdaphotos/8212408724/38Wednesday, May 8, 2013
  39. 39. Views wizardPage or blockDisplay settingsAdd to menuhttp://www.flickr.com/photos/fdaphotos/8212408724/38Wednesday, May 8, 2013
  40. 40. Views wizardPage or blockDisplay settingsAdd to menuhttp://www.flickr.com/photos/fdaphotos/8212408724/38Wednesday, May 8, 2013
  41. 41. Views editorHow to format & displayWhat to select & filter39Wednesday, May 8, 2013
  42. 42. 1. Choose what to queryTaxonomycity breakCommentsUsersD. SchruteGermanyJ. HalpertSpainadventurecity breaksailingshoppingdwight8 SeptWow, cantwait to getvisit.joe8 SeptMe too!ContentContent title• What do you want to list?• You can’t change it later.• You can use a relationship later to jointables.40Wednesday, May 8, 2013
  43. 43. 2. Filter to limit selection• Limit a set of data to display for example,filtering by author.41Wednesday, May 8, 2013
  44. 44. 2. Filter to limit selection• ... or limit by content type42Wednesday, May 8, 2013
  45. 45. 2. Select fields21343Wednesday, May 8, 2013
  46. 46. 3. Specify format44Wednesday, May 8, 2013
  47. 47. 3. Configure formatting45Wednesday, May 8, 2013
  48. 48. 3. Even rewrite output!21346Wednesday, May 8, 2013
  49. 49. 4. Choose a display47Wednesday, May 8, 2013
  50. 50. Output48Wednesday, May 8, 2013
  51. 51. Step by step• 1. Choose what to query• 2. Limit selection with filters• View modes or fields• 3. Select and configure formatting• 4. Choose displays - and/or addattachments49Wednesday, May 8, 2013
  52. 52. Demo: Customize theview add a displayThe second demo!50Wednesday, May 8, 2013
  53. 53. Edit News view• Add a block display• Choose fields• Place in sidebar & test it• Change fields or filter• Change display51Wednesday, May 8, 2013
  54. 54. Display tips• Name your displays• Make a new view if displays are very different• Be careful to select specific displays whenediting options52Wednesday, May 8, 2013
  55. 55. Recap• 1. What to select & filter?• Select base table to start (you can combinetables with relationships).• Apply filters• Select fields or “view mode”• 2. How to format & display?• Choose a format such as list, table, etc.• Choose a display such as pages, blocks,RSS feeds. More displays available!53Wednesday, May 8, 2013
  56. 56. Where are you at?New toDrupalExperiencedwith DrupalWhat the heckis Views??I can make viewswith one handbehind my back54Wednesday, May 8, 2013
  57. 57. VIEWS NEXT STEPS!Your assignment55Wednesday, May 8, 2013
  58. 58. Your assignment• Create a view before next week!• List a specific type of content or all terms• Create a page display and a block display• Place the block in the sidebar of your site• Quick version: 4 parts, 5 mins each!http://www.drupalgardens.com/content/new-views-tutorials-4-part-intro56Wednesday, May 8, 2013
  59. 59. Views webinar!• Tips and Tricks for Getting the Most Out ofViews [April 30, 2013]• http://j.mp/mostviews• Suzanne Kennedy, Evolving Web - one of ourtraining partners.http://training.acquia.com/events/canada• DrupalCon: Mastering Views Configuration• http://portland2013.drupal.org/node/371857Wednesday, May 8, 2013
  60. 60. Views tutorials• Quick version: 4 parts, 5 minseach!http://www.drupalgardens.com/content/new-views-tutorials-4-part-intro• Drupalize.mehttp://drupalize.me/videos/overview-views• 10 part series with “TorontoWeb Developer”http://j.mp/Zc8nEO58Wednesday, May 8, 2013
  61. 61. Next up!• Viws mini course- May 2nd: Introduction to Views- May 8th: How to build flexible views < -- next week!- May 15th: Build your first module to back up your views!• Drupal essentials- May 22nd: Drupal Essentials: How to Configure Accounts in Drupal• Drupal for Project Managers mini-course- May 29th-June 19th: 4 weeks - Drupal for Project Managers!Adam Boysen, Jakub Suchy, Amye Scavarda, Jenn Sramek59Wednesday, May 8, 2013
  62. 62. Notes from class• I put the notes up here• https://www.acquia.com/blog/totally-beginner-tutorial-views-drupal-760Wednesday, May 8, 2013
  63. 63. Events! Learn in person• http://acquia.com/events• http://training.acquia.com/events• http://dublin2013.drupaldays.org/• http://www.drupical.com/61Wednesday, May 8, 2013

×