SlideShare a Scribd company logo
 
Setup, Intro Views Basics Argument Handling Tabbed Views Templating Fusion / Union A Break From Views Actions Workflow Workflow_NG CCK Computed Field  (time permitting) Development Tips phpED demo Multisite for Multi-User More Views  (time permitting) Views_build_view() Views and AJAX Views_Calc Morning : 8 to 12 Afternoon : 1 to 5 BREAK BREAK LUNCH
What is VIEWS?  http://av1.example1/admin/build/views/add   A smart SQL query builder (plus extras) By default –  “a view is a list of ALL site nodes” … but… …  this is more useful when we FILTER to show only specific nodes Arguments and filters can be set to limit which  nodes  to “list” Can also: select which fields to use sort theme
Keep in mind – views lists nodes.  (Exercise 1, 1a) Drupal saying:  “everything’s a node” … but, of course, not really everything… Lots of things in Drupal aren’t natively nodes” Users Taxonomy terms Comments And others But there are modules to make most of these things into nodes… so then they can be used with views..  
Page or Block Very similar except Block Views automatically show in the Block admin page so block functions apply (page filters, per theme, weightings, etc) View Type List ( ALWAYS use this to theme ) Table – nice if you want to throw together a quick table Teaser – very handy if you theme a teaser (contemplate) and have many views that use same teaser template Other modules can add other types (RSS, etc)
Fields – Table and List only Pick which fields to show on your view Filters and Arguments Pick which nodes to show Arguments: use $_GET (i.e. URL) to pass arguments to use for filtering (more on this later) Exposed Filters Let users chose filtering options  (Exercise 2) Sort
Arguments are basically filters But we can  take  arguments from URL to use in our filters  (Exercise 3) Why  take  instead of  pass ? Block views can also read from URL Argument handling code (PHP) allows us to convert argument into what the filter is designed to handle Think of: better to have URL with text but need ID for filter. But also other uses: Embed into the views array  ( http://av1.eclipse/archived )  Handle end cases – i.e. filter bad arguments  ( http://av1.training/user/blah/my_widgets )  (Exercise 6)
Used to collect multiple views together on single page  (Exercise 4) Views automatically builds tabbed pages for you based on path provided Can also add to existing pages such as User, or other existing tabs created by 3 rd  party modules  (Exercise 5)
Easiest approach is to theme a node type’s teaser and then just use teaser views… …  but when that’s not enough… Views provides very powerful templating support. Basic approach  (Exercise 7) List view  (only LIST views work for templating) Select required fields Use views Theme Wizard to get code for template.php, views-list-[view_name].tpl.php, views-list-[view_name].css
All tpl files belong in the theme folder LiquidCMS Enhancements: Support for multiple themes by better use of “default theme” concept (Drupal 5) Views_templater() function to simplify template.php code  Drupal 6 has much better theming support through the use of hierarchical themes
Allows user to pull in  “related”   information Nodes need to use some form of relational linking to join them together Node_family set of modules or CCK nodereference field are currently supported – but most cases you will want to use nodereference field Examples: numerous examples on  http://av1.umg
Simply ORs multiple views together  (Exercise 8) A bit tricky when using views with arguments or exposed filters Drupal 6: both views_union and views_fusion modules have been made obsolete by Drupal 6 as Views 2 handles node relationships. This is a VERY good thing as both these modules are a bit flaky.
 
An action is a specially written PHP function whose parameters are configured through the web. Action templates may be added by other modules and then the site admin may add instances of this action by filling out template.  ( http://av1.workflow/admin/build/actions )  Actions include things like sending an email or changes workflow state of a node. Modules can then call these actions when needed
Workflows define “states” for different node types And then help us manage the transition of nodes through this “state machine” Add on modules provide various functionality driven by a node’s state – for example: Fire an action (e.g. send an email) when a node passes from one state to another Control access privileges based on the state a node is in
“ A rule-based event driven action evaluation system.” Much different than Workflow – whereas Workflow only manages tracking a nodes states, _NG provides a configurable action system with it. Sort of like combining Actions and Workflows – but these aren’t standard Drupal Actions – but for Drupal 6, workflow_ng will support Drupal actions.
Lets you add a computed (i.e. PHP) field to a custom content type Choose whether to store your computed field in the database.  Value of the field is set using PHP code so it can draw on anything available to Drupal: other fields the current user database tables etc. More info:  http://drupal.org/node/126522
PHP Debugger (NuSphere) If you are doing code design - a debugger is your most powerful tool LiquidCMS recommendation: phpEd  ( http://www.nusphere.com/ )   Breakpoints, including conditional breakpoints Traverse call stack Remote debugging PHP and MySQL manuals built in Look up user defined functions, php functions, files with simple right click  DEMO
Use Drupal’s multisite capabilities to help with multi-developer environments. Create a site folder per user: site1.jayson, site1.adam, site1.joe Along side: www.site1.gc.ca, stage1.intranet, etc Each user can set specific site “variable” settings using their custom $conf array in settings.php Developers can add their own modules under sites/mysite/modules folder that other users won’t see
Devel Many useful tools including SQL query report www.drupal.org/project/devel   Coder Highlights proper coding style www.drupal.org/project/coder   Masquerade Easy switching between other user www.drupal.org/project/masquerade
LiquidCMS Devel Modules: Php_errors: monitors php errors which are occurring on your site, archives a weekly list, emails report to defined roles -  www.drupal.org/project/php_errors   Mail_redirect: when using db with “live” email addresses; this module prevents spamming users during testing and redirects all site email to test mail domain – see  www.drupal.org/projects/mail_redirect  for more info
Programatically call a view Endless uses: Call a view inside a view template to get embedded views Great for AJAX calls Examples: http://av1.umg/artist/amy-winehouse http://av1.umg/search-main/ http://av1.umg/artist-news/snoop-shoots-jay-z
Module adds simple calculations to a views table.  You can SUM, AVERAGE, or COUNT a selection of fields in a row, or perform the same calculations on selected columns. Gives spreadsheet like capabilities to Table views.
Exercise 1: All Widgets  (all_widgets) Basic Exercise 1a: My Widgets  (admin_widgets, my_widgets) Simple filter Exercise 2: Pick User’s Widgets  (pick_widgets) Exposed filter Exercise 3: User’s Widgets  (users_widgets) Simple argument handling Dynamic titles
Exercise 4: Tabbed Widget’s (Users) Widget page with a tab for each user’s widgets Exercise 5: MyAccount Tab  (myaccount_widgets) Add tab to existing tab sets Exercise 6: MyAccount Tab  (myaccount_widgets) Arg handling code Exercise 7: View Templates  (admin_widgets2)   Exercise 8: Views Union  (robyn_s_admin_w) Join 2 views together using the views_union module

More Related Content

PDF
Passing java arrays in oracle stored procedure from mule esb flow
PPTX
Stored procedure in sql server
PPTX
Drupal8 render pipeline
PDF
New Stuff in the Oracle PL/SQL Language
PPT
Struts,Jsp,Servlet
PPT
01 oracle architecture
PPTX
Using parse template component
PPTX
High Performance Plsql
Passing java arrays in oracle stored procedure from mule esb flow
Stored procedure in sql server
Drupal8 render pipeline
New Stuff in the Oracle PL/SQL Language
Struts,Jsp,Servlet
01 oracle architecture
Using parse template component
High Performance Plsql

What's hot (18)

PPTX
Stored procedure tunning
PPTX
Store procedures
PPTX
Advance Sql Server Store procedure Presentation
PPTX
DOCX
13th Sep - Drupal Global Training Day by TCS - Drupal core advanced overview
PDF
PPT
Struts 2 Overview
PPT
Introducing Struts 2
KEY
Hibernate Performance Tuning (JEEConf 2012)
PPT
Oracle SQL, PL/SQL Performance tuning
PDF
Jsp standard tag_library
PPT
Intro to tsql
PPT
Struts course material
PPTX
Sql Functions And Procedures
PPTX
Chapter 4 functions, views, indexing
PPTX
Oracle DB Performance Tuning Tips
PDF
OpenDMS - the first 2 weeks
Stored procedure tunning
Store procedures
Advance Sql Server Store procedure Presentation
13th Sep - Drupal Global Training Day by TCS - Drupal core advanced overview
Struts 2 Overview
Introducing Struts 2
Hibernate Performance Tuning (JEEConf 2012)
Oracle SQL, PL/SQL Performance tuning
Jsp standard tag_library
Intro to tsql
Struts course material
Sql Functions And Procedures
Chapter 4 functions, views, indexing
Oracle DB Performance Tuning Tips
OpenDMS - the first 2 weeks
Ad

Viewers also liked (7)

PDF
Sinking like a BRIC: Better Choices than Brazil, Russia,
PPT
Practice Power Point- Google Docs
PPT
What is \"quadratic\"?
PPS
Elartedenoenfermarse
PPT
Crystal Fire Part II
PPT
Open Innovation
PPT
Open Innovation Y Sus Ventajas Sobre La GestióN Del Conocimiento
Sinking like a BRIC: Better Choices than Brazil, Russia,
Practice Power Point- Google Docs
What is \"quadratic\"?
Elartedenoenfermarse
Crystal Fire Part II
Open Innovation
Open Innovation Y Sus Ventajas Sobre La GestióN Del Conocimiento
Ad

Similar to Dn D Custom 1 (20)

PPTX
Jay Callicott Drupal Views 2.0 Presentation
PPTX
Intro to Drupal Slides - DrupalCampSC 2014
PPT
Drupal: an Overview
PDF
Staying Sane with Drupal NEPHP
ODP
Views for hackers v1.3
PDF
Staying Sane with Drupal (A Develper's Survival Guide)
PPT
Drupal101
PDF
Introduction to Drupal Basics
PDF
Introduction To Drupal
PDF
Staging Drupal 8 31 09 1 3
PPTX
Drupal_cubet seminar
PPT
ODP
Drupal Views development
PPTX
Online Drupal Training Syllabus
DOCX
Creating a licensing database using drupal 7
PDF
Drupal Global Training Day by Drupal Mumbai 6th Sep - Drupal Terminologies
KEY
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...
PDF
Basic Views
PPT
Drupal: Content Management and Community for your Library
PDF
Building A Tasty Backend
Jay Callicott Drupal Views 2.0 Presentation
Intro to Drupal Slides - DrupalCampSC 2014
Drupal: an Overview
Staying Sane with Drupal NEPHP
Views for hackers v1.3
Staying Sane with Drupal (A Develper's Survival Guide)
Drupal101
Introduction to Drupal Basics
Introduction To Drupal
Staging Drupal 8 31 09 1 3
Drupal_cubet seminar
Drupal Views development
Online Drupal Training Syllabus
Creating a licensing database using drupal 7
Drupal Global Training Day by Drupal Mumbai 6th Sep - Drupal Terminologies
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...
Basic Views
Drupal: Content Management and Community for your Library
Building A Tasty Backend

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Cloud computing and distributed systems.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
cuic standard and advanced reporting.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Approach and Philosophy of On baking technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Review of recent advances in non-invasive hemoglobin estimation
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Empathic Computing: Creating Shared Understanding
Cloud computing and distributed systems.
The Rise and Fall of 3GPP – Time for a Sabbatical?
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Programs and apps: productivity, graphics, security and other tools
NewMind AI Weekly Chronicles - August'25 Week I
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Machine learning based COVID-19 study performance prediction
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
cuic standard and advanced reporting.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Spectroscopy.pptx food analysis technology
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Approach and Philosophy of On baking technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Advanced methodologies resolving dimensionality complications for autism neur...
Digital-Transformation-Roadmap-for-Companies.pptx

Dn D Custom 1

  • 1.  
  • 2. Setup, Intro Views Basics Argument Handling Tabbed Views Templating Fusion / Union A Break From Views Actions Workflow Workflow_NG CCK Computed Field (time permitting) Development Tips phpED demo Multisite for Multi-User More Views (time permitting) Views_build_view() Views and AJAX Views_Calc Morning : 8 to 12 Afternoon : 1 to 5 BREAK BREAK LUNCH
  • 3. What is VIEWS? http://av1.example1/admin/build/views/add A smart SQL query builder (plus extras) By default – “a view is a list of ALL site nodes” … but… … this is more useful when we FILTER to show only specific nodes Arguments and filters can be set to limit which nodes to “list” Can also: select which fields to use sort theme
  • 4. Keep in mind – views lists nodes. (Exercise 1, 1a) Drupal saying: “everything’s a node” … but, of course, not really everything… Lots of things in Drupal aren’t natively nodes” Users Taxonomy terms Comments And others But there are modules to make most of these things into nodes… so then they can be used with views.. 
  • 5. Page or Block Very similar except Block Views automatically show in the Block admin page so block functions apply (page filters, per theme, weightings, etc) View Type List ( ALWAYS use this to theme ) Table – nice if you want to throw together a quick table Teaser – very handy if you theme a teaser (contemplate) and have many views that use same teaser template Other modules can add other types (RSS, etc)
  • 6. Fields – Table and List only Pick which fields to show on your view Filters and Arguments Pick which nodes to show Arguments: use $_GET (i.e. URL) to pass arguments to use for filtering (more on this later) Exposed Filters Let users chose filtering options (Exercise 2) Sort
  • 7. Arguments are basically filters But we can take arguments from URL to use in our filters (Exercise 3) Why take instead of pass ? Block views can also read from URL Argument handling code (PHP) allows us to convert argument into what the filter is designed to handle Think of: better to have URL with text but need ID for filter. But also other uses: Embed into the views array ( http://av1.eclipse/archived ) Handle end cases – i.e. filter bad arguments ( http://av1.training/user/blah/my_widgets ) (Exercise 6)
  • 8. Used to collect multiple views together on single page (Exercise 4) Views automatically builds tabbed pages for you based on path provided Can also add to existing pages such as User, or other existing tabs created by 3 rd party modules (Exercise 5)
  • 9. Easiest approach is to theme a node type’s teaser and then just use teaser views… … but when that’s not enough… Views provides very powerful templating support. Basic approach (Exercise 7) List view (only LIST views work for templating) Select required fields Use views Theme Wizard to get code for template.php, views-list-[view_name].tpl.php, views-list-[view_name].css
  • 10. All tpl files belong in the theme folder LiquidCMS Enhancements: Support for multiple themes by better use of “default theme” concept (Drupal 5) Views_templater() function to simplify template.php code Drupal 6 has much better theming support through the use of hierarchical themes
  • 11. Allows user to pull in “related” information Nodes need to use some form of relational linking to join them together Node_family set of modules or CCK nodereference field are currently supported – but most cases you will want to use nodereference field Examples: numerous examples on http://av1.umg
  • 12. Simply ORs multiple views together (Exercise 8) A bit tricky when using views with arguments or exposed filters Drupal 6: both views_union and views_fusion modules have been made obsolete by Drupal 6 as Views 2 handles node relationships. This is a VERY good thing as both these modules are a bit flaky.
  • 13.  
  • 14. An action is a specially written PHP function whose parameters are configured through the web. Action templates may be added by other modules and then the site admin may add instances of this action by filling out template. ( http://av1.workflow/admin/build/actions ) Actions include things like sending an email or changes workflow state of a node. Modules can then call these actions when needed
  • 15. Workflows define “states” for different node types And then help us manage the transition of nodes through this “state machine” Add on modules provide various functionality driven by a node’s state – for example: Fire an action (e.g. send an email) when a node passes from one state to another Control access privileges based on the state a node is in
  • 16. “ A rule-based event driven action evaluation system.” Much different than Workflow – whereas Workflow only manages tracking a nodes states, _NG provides a configurable action system with it. Sort of like combining Actions and Workflows – but these aren’t standard Drupal Actions – but for Drupal 6, workflow_ng will support Drupal actions.
  • 17. Lets you add a computed (i.e. PHP) field to a custom content type Choose whether to store your computed field in the database. Value of the field is set using PHP code so it can draw on anything available to Drupal: other fields the current user database tables etc. More info: http://drupal.org/node/126522
  • 18. PHP Debugger (NuSphere) If you are doing code design - a debugger is your most powerful tool LiquidCMS recommendation: phpEd ( http://www.nusphere.com/ ) Breakpoints, including conditional breakpoints Traverse call stack Remote debugging PHP and MySQL manuals built in Look up user defined functions, php functions, files with simple right click DEMO
  • 19. Use Drupal’s multisite capabilities to help with multi-developer environments. Create a site folder per user: site1.jayson, site1.adam, site1.joe Along side: www.site1.gc.ca, stage1.intranet, etc Each user can set specific site “variable” settings using their custom $conf array in settings.php Developers can add their own modules under sites/mysite/modules folder that other users won’t see
  • 20. Devel Many useful tools including SQL query report www.drupal.org/project/devel Coder Highlights proper coding style www.drupal.org/project/coder Masquerade Easy switching between other user www.drupal.org/project/masquerade
  • 21. LiquidCMS Devel Modules: Php_errors: monitors php errors which are occurring on your site, archives a weekly list, emails report to defined roles - www.drupal.org/project/php_errors Mail_redirect: when using db with “live” email addresses; this module prevents spamming users during testing and redirects all site email to test mail domain – see www.drupal.org/projects/mail_redirect for more info
  • 22. Programatically call a view Endless uses: Call a view inside a view template to get embedded views Great for AJAX calls Examples: http://av1.umg/artist/amy-winehouse http://av1.umg/search-main/ http://av1.umg/artist-news/snoop-shoots-jay-z
  • 23. Module adds simple calculations to a views table. You can SUM, AVERAGE, or COUNT a selection of fields in a row, or perform the same calculations on selected columns. Gives spreadsheet like capabilities to Table views.
  • 24. Exercise 1: All Widgets (all_widgets) Basic Exercise 1a: My Widgets (admin_widgets, my_widgets) Simple filter Exercise 2: Pick User’s Widgets (pick_widgets) Exposed filter Exercise 3: User’s Widgets (users_widgets) Simple argument handling Dynamic titles
  • 25. Exercise 4: Tabbed Widget’s (Users) Widget page with a tab for each user’s widgets Exercise 5: MyAccount Tab (myaccount_widgets) Add tab to existing tab sets Exercise 6: MyAccount Tab (myaccount_widgets) Arg handling code Exercise 7: View Templates (admin_widgets2) Exercise 8: Views Union (robyn_s_admin_w) Join 2 views together using the views_union module

Editor's Notes

  • #2: table, list and teaser views View tabs Argument handling Views templating/theming filters and exposed filters Views Modules: View calc fusion and union of views usernodes Non-Views: Actions, workflow, workflow_ng CCK Computed field Advanced: views_build_view function and how to use views in ways you'd never think of query substitution - when you can't quite get it right. ajax and views