+ All Categories
Home > Technology > Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Date post: 13-May-2015
Category:
Upload: acquia
View: 3,582 times
Download: 0 times
Share this document with a friend
Popular Tags:
76
Drupal 7 - Building flexible views! acquia.com Wednesday, May 8, 2013
Transcript
Page 1: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Drupal 7 - Building flexible views!

acquia.comWednesday, May 8, 2013

Page 2: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Heather James Manager of Training at Acquia

HELLO!

@learningdrupal

@hjames

Wednesday, May 8, 2013

Page 3: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Acquia Training

http://training.acquia.comWednesday, May 8, 2013

Page 4: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Course materials

• Tested in hundreds of classrooms.

• Continuously updated.• Clear and easy follow, but

engaging content. • Blend of guided and

challenge exercises to test skills.

http://training.acquia.com/courses

The materials / handouts were very

comprehensive - personally I would not

change anything.

- O.G. Jan 2012

Wednesday, May 8, 2013

Page 5: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

The trainers are partners

• Our trainers are experienced developers who love teaching.

• They provide subject matter expertise as well as well as passion for the topic.

• Partners are placed all over the globe.

http://training.acquia.com/testimonials

Lovely presenter, very patient and open to

questions. I feel a lot more confident to use

drupal myself and understand the

technical underpinnings.

- C.L., Sept 2012

Wednesday, May 8, 2013

Page 6: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

• Popular packages are typical examples of the tailored packages we have delivered.

Tailored courses available

http://training.acquia.com/eventsWednesday, May 8, 2013

Page 7: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

In todayʼs webinar!

• Viws mini course - May 2nd: Introduction to Views- May 8th: How to build flexible views < -- you are here- 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 Sramek

Wednesday, May 8, 2013

Page 8: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

What weʼre doing today

• Building flexible views• Using relationships to expand selection• Using attachments• Using contextual filters• Best practices to finish your view

Wednesday, May 8, 2013

Page 9: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

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 modules

• From last week: How Views works, how to add a new View

Wednesday, May 8, 2013

Page 10: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

BUILDING FLEXIBLE VIEWS

Finding your way around

Wednesday, May 8, 2013

Page 11: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Recap last class

Wednesday, May 8, 2013

Page 13: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Recap

• What do you want to select?

• Select base table to start (you can combine tables with relationships).

• Apply filters

• Select fields or “view mode”

• Where and how should it appear?

• Choose a format such as list, table, etc.

• Choose a display such as pages, blocks, RSS feeds. More displays available!

Wednesday, May 8, 2013

Page 14: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Step by step workflow

• 1. Choose what to query

• 2. Limit selection with filters and/or by fields

• 3. Select and configure formatting

• 4. Choose displays - and/or add attachments

Wednesday, May 8, 2013

Page 15: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Views is a query builder

• Click to create queries with Views.

• Filters to limit selection can be static or contextual.

• You can see the actual query written.

Wednesday, May 8, 2013

Page 16: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Views UI in detail

Wednesday, May 8, 2013

Page 17: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Views wizard

Page or blockDisplay settingsAdd to menu

Wednesday, May 8, 2013

Page 18: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Views wizard

Page or blockDisplay settingsAdd to menu

Wednesday, May 8, 2013

Page 19: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Views wizard

Page or blockDisplay settingsAdd to menu

Wednesday, May 8, 2013

Page 20: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Views editor

How to format & displayWhat to select & filter

Wednesday, May 8, 2013

Page 21: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Start by filtering selection

1

4

23

5

What to select & filter

Wednesday, May 8, 2013

Page 22: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

How and where to display

1

23

5

4

6

How to format & display

Wednesday, May 8, 2013

Page 23: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Format and displayControlling display

Wednesday, May 8, 2013

Page 24: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Jump menu

Wednesday, May 8, 2013

Page 25: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Table formatting

• Customize labels - the column headers

• Make columns sortable

• Add links to edit for administrators

Wednesday, May 8, 2013

Page 26: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Be consistent

• Look at how things are done across your site

• Example: If adding admin views, follow order of fields in core Drupal

Wednesday, May 8, 2013

Page 27: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Frequent formatting?

Wednesday, May 8, 2013

Page 28: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Site wide formatting!

1

2

Wednesday, May 8, 2013

Page 29: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Think reusability!

Wednesday, May 8, 2013

Page 30: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

View modes?

• Use the default view modes

• Display Suite - to create custom modes

• These are reusable, easier to manage across many views.

• Easier for theming!

Wednesday, May 8, 2013

Page 31: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Manage display

Web Page TitleGoogle

Teaser page

(thumbnail)

(thumbnail)

(thumbnail)

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia,

Lost luggage tips

Countries Vokalia and Consonantia, there live the blind texts. Separated they live.

What not to pack

Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language.

Luxury on a shoestring

http://example.com/articlesWeb Page Title

Google

Log in

name

password

Login

http://example.com/articles/lost

AdventurousBudget mindedFamiliesHigh !iers

For the traveler

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia. Separated they live in Bookmarksgrove right at the coast of Semantics, a large language ocean.

Who to contactThe airlineYour credit card companyTravel insurance

Lost luggage tips

(full article)

Full content

Example: Thumbnail in teaser Example: Full content image

Control “view modes”

Wednesday, May 8, 2013

Page 32: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Image styles available

• Add an image style

• Configure display on a content type

Wednesday, May 8, 2013

Page 33: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Think first

• Consistency!

• Reusability!

• Who can access it?

• What can they do?

Wednesday, May 8, 2013

Page 34: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Access control

Wednesday, May 8, 2013

Page 35: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Access restrictions

• By permission is easier to manage in future

Wednesday, May 8, 2013

Page 36: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Filters

Wednesday, May 8, 2013

Page 37: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Filters

• Expose filters to users

• Use permissions on a view

Wednesday, May 8, 2013

Page 38: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Demo: Exposed filter

• Review existing view: Content by user

• Expose filter to viewers (add another)

• Insert an edit link for admins

• Change access control of View

• Path: /admin/content/user

Wednesday, May 8, 2013

Page 39: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Pagers

Wednesday, May 8, 2013

Page 40: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Pagers

• Decide if you need pagers.

• Use Ajax loading for sidebars (demo)

Wednesday, May 8, 2013

Page 41: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Inifite scroll?

• Views Infinite Scrollhttp://drupal.org/project/views_infinite_scroll

Wednesday, May 8, 2013

Page 42: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Attachments

Wednesday, May 8, 2013

Page 43: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Views attachments

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.

Best in Beppu

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.

Paris excursions

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.

Mali music

Articles

Adventurous appetites?Budget minded plansOutdoorsy typesAirlines competing for new customers

Wednesday, May 8, 2013

Page 44: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Demo

• Look at an attachment to an existing view.

• Uses offset.

Wednesday, May 8, 2013

Page 45: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Relationships

Wednesday, May 8, 2013

Page 46: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Get data from other tables

Wednesday, May 8, 2013

Page 47: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Example: related content

Job listing contains an Entity reference to “Company” Wednesday, May 8, 2013

Page 48: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Demo

• Add a new view listing users

• Change to field display

• Check the field options available. Add user image.

• Add a relationship to content written.

Wednesday, May 8, 2013

Page 49: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Contextual filters

Wednesday, May 8, 2013

Page 50: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Contextual filters

• Display related content across the site

Wednesday, May 8, 2013

Page 51: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Example

• https://www.acquia.com/about-us/team/heather-james Wednesday, May 8, 2013

Page 52: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Demo

• Add a block view

• Pull in user ID

• Select, sort and format content

• Place the block!

• Look at related recipes example.

Wednesday, May 8, 2013

Page 53: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Add links to menus

Wednesday, May 8, 2013

Page 54: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Adding menus

• You can add a link to your view anywhere in your menus.

• You can create menus within a set of views!

Wednesday, May 8, 2013

Page 55: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Menus available

Wednesday, May 8, 2013

Page 56: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Add as menu tab

Wednesday, May 8, 2013

Page 57: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Access settings

Wednesday, May 8, 2013

Page 58: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Tab appears!

Wednesday, May 8, 2013

Page 59: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Demo

• How to add a menu item

• Add “my recipes” to main menu.

• Add a parent menu item and sub-menu items

• Look at a live version on our training site In D6)

Wednesday, May 8, 2013

Page 60: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Contributed modules that love Views

Wednesday, May 8, 2013

Page 61: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Views related modules312 Drupal 7 modules http://j.mp/Y2cy6R

Wednesday, May 8, 2013

Page 62: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Calendar

http://drupal.org/project/calendarWednesday, May 8, 2013

Page 63: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

with jQuery

http://www.webomelette.com/10-drupal-views-modules

Wednesday, May 8, 2013

Page 64: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Example: Slideshow

Wednesday, May 8, 2013

Page 65: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Adds a format & options

Wednesday, May 8, 2013

Page 66: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Views for admins

• Admin Views http://drupal.org/project/admin_views

• Overrides all admin pages with Views!

• Views bulk operations http://drupal.org/project/views_bulk_operations

• Provides a display format and editing options such as changing author or field values

Wednesday, May 8, 2013

Page 67: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Workbench

http://drupal.org/project/workbench

Wednesday, May 8, 2013

Page 68: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Demo: VBO

• If time allows!

• Demo modifying a view to add views bulk operations.

• Add to the Content by user list.

• Add a "Bulk operations" field, available to all entity types.

• Configure the options available

Wednesday, May 8, 2013

Page 69: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Configure VBO

• Add field and selection options available

Wednesday, May 8, 2013

Page 70: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

VIEWS NEXT STEPS!Your assignment

Wednesday, May 8, 2013

Page 71: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Your assignment

• Last week you made a view, right?

• This week:

• Add a display with an attachment

• Make a contextual filter or use a relationship

• Add a link to your menu

• Watch tutorials 4 parts, 5 mins each! http://www.drupalgardens.com/content/new-views-tutorials-4-part-intro

Wednesday, May 8, 2013

Page 72: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Views webinar!

• Tips and Tricks for Getting the Most Out of Views [April 30, 2013]

• http://j.mp/mostviews

• Suzanne Kennedy, Evolving Web - one of our training partners.http://training.acquia.com/events/canada

• DrupalCon: Mastering Views Configuration

• http://portland2013.drupal.org/node/3718

Wednesday, May 8, 2013

Page 74: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Next up!

• Viws mini course - May 2nd: Introduction to Views- May 8th: How to build flexible views < -- you are here- 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 Sramek

Wednesday, May 8, 2013

Page 75: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Next week:

• Views Quality Assurance• Theming Views• Caching and performance tips• Build a module to back up your view!

Wednesday, May 8, 2013

Page 76: Views Mini-Course, Part II: Creating Flexible Views with Drupal 7

Events! Learn in person

• http://acquia.com/events

• http://training.acquia.com/events

• http://dublin2013.drupaldays.org/

• http://www.drupical.com/

Wednesday, May 8, 2013


Recommended