SlideShare a Scribd company logo
Mastering Views
Andrey Yurtaev
Session plan
Interface overview:
● Most of UI elements
Examples:
● Agregation
● Contextual filters
● Theming
● Admin pages
● Overriding pages output
Sorry, no cats :(
Lets go
Views data types
● Comments
● Content
● Content revisions
● Files
● Taxonomy terms
● Users
● D7: Theme engine
● D8: Custom block
● D8: Custom block revisions
● D8: Log entries
Views UI
Views Displays
● Attachment
● Block
● Feed
● Page
● D8: Embed
● D8: Entity reference
Format and Show
Format:
● Grid
● HTML List
● Table
● Unformatted list
● D7: Jump menu
Show:
● Content
● Fields
● D8: Search results
Important thing: Grouping field
Fields
Depends on data type
Filters
Important things:
● Exposed filters
● Exposed form settings
Useful module: Better Exposed Filters
Sort
Display settings
Page:
● Path
● Menu
Header, Footer and No results
Important things:
● Unfiltered text
● View area
● D8: Rendered entity
● D7 module: Views block area
View with no results:
Filter: Nid = 0
Pager
Good alternatives:
● Views Infinite Scroll
● Views Load More
Contextual filters
Relationships
Other
Important things:
● AJAX
● Query settings:
○ Disable SQL rewriting
○ Distinct
Views and Displays
Important things:
● Clone views
● Export/Import views
● Clone displays
● Overriding displays
Translate views: Internationalization Views
Examples
Generated content
Taxonomy: Genres
Content type: Author
● Name (Title): Text
● Bio (Body): Long text
Content type: Book
● Title: Text
● Description (Body): Long text
● Author (D7 module: Entity reference)
● Genre: Term reference
Aggregation
View name: Books by genres
Data type: Content, Book
Display: Page
Display format: HTML list, fields
Use aggregation: Yes
Field: Genre, Group results together
Field: Genre, Count
Contextual filters
View name: Author info
Data type: Content, Book
Display: Block
Display format: unformatted list, fields
Field: Author, Rendered entity
Contextual filter: Node ID, Provide default value -
Content ID from URL
Place block Author info: Only for content type - Book
Replacement tokens in Header
Clone Taxonomy term
Display format: unformatted list, fields
Fields: Title, Body
Relationship: Genre
Field: Term description, Exclude from display
Header: Unfiltered text,
Use replacement tokens from the first row
Theming
View name: Books grid view
Data type: Content, Book
Display: Page
Display format:
unformatted list,
row class -
col-xs-12 col-sm-6 col-
md-4
Uncheck Add row classes
Add to theme: views-view--books-
grid-view
.tpl.php
- <div class="view-content">
+ <div class="view-content row">
<?php print $rows; ?>
</div>
Admin pages
View name: Books admin
Data type: Content, Book
Display: Page
Path: admin/content/books
Display format: table
Menu: Menu tab, Management
Field: Title, etc.
Field: Draggableviews: Content
Field: Draggableviews: Weight
Sort criteria: Draggableviews: Weight
Extra module:
DraggableViews
Useful modules:
● Views Bulk Operations
● Commerce Backoffice
Overriding default page output by View
For texonomy term pages:
Path: taxonomy/term/%
Contextual filter: tid, Provide default value -
Taxonomy term ID from URL
Or module Taxonomy display
For user pages:
Path: user/%
Contextual filter: uid, Provide default value - User ID from URL
Overriding node output by View
View name: Book
Display: Page
Path: does not meter,
something like book/%
Contextual filter: nid,
Provide default value -
Content ID from URL,
Override title - %1
Add to theme:
node--book.tpl.php
- print render($content);
+ print views_embed_view('book',
'page', $node->nid);
Overriding node output by View page 2
Field: Body, Exclude from display
Field: Author, Exclude from display
Field: Custom text
<div class="row">
<div class="col-xs-12 col-sm-8">[body]</div>
<div class="col-xs-12 col-sm-4">[field_author]</div>
</div>
Summary
Views is great tool for:
● Node layout (instead Display Suite)
● Page layout (instead Panels)
● Awesome search (with Search API)
● Products catalog (with Drupal Commerce)
● DrupalCamp site :)
Thank You!
Questions?
Gold sponsorWith support Silver sponsors

More Related Content

PPTX
Elements
PPT
PPTX
Fundamentals of Web building
PPTX
DOCX
Resume 2016
PPTX
PPTX
Elements
Fundamentals of Web building
Resume 2016

Viewers also liked (12)

PPTX
PDF
Ivan Kotlyar. PostgreSQL in web applications
PDF
Sergey Cherebedov. Deployment of the environment for Drupal using Ansible.
PPT
Changing role of IMF in global Scenario
PDF
rei-explorer-case-study
PDF
kindle-social-case-study
PPT
Researching women’s work: reflections on ‘Women on the Line’
PDF
Unicamp 2010 1ª fase
PPT
Practice Hunting
PPTX
Heavenhu art 130
PDF
Михаил Крайнюк - Form API + Drupal 8: Form and AJAX
PPTX
Բնությունը մարդու կյանքում
Ivan Kotlyar. PostgreSQL in web applications
Sergey Cherebedov. Deployment of the environment for Drupal using Ansible.
Changing role of IMF in global Scenario
rei-explorer-case-study
kindle-social-case-study
Researching women’s work: reflections on ‘Women on the Line’
Unicamp 2010 1ª fase
Practice Hunting
Heavenhu art 130
Михаил Крайнюк - Form API + Drupal 8: Form and AJAX
Բնությունը մարդու կյանքում
Ad

Similar to Андрей Юртаев - Mastering Views (20)

PDF
Tips and Tricks for Getting the Most out of Views
PDF
Drupal for Non-Developers
PDF
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8
PPT
Drupalcamp
PDF
Active Tags and Taxonomy Views Drupal Drop In November 2010
PDF
Streamlined Drupal 8: Site Building Strategies for Tight Deadlines
PPTX
The panels family
PPTX
SharePoint 2010 for Devs
PDF
The Missing Modules
PDF
Lesson 15
PDF
Drupal Cafe №5 Харьков. Drupal 7 Views 3.
PPT
Hillel of Greater Philadelphia Web Training (8/09)
PPTX
DrupalCamp Florida 2015 - One Content Type to Rule Them All
PPTX
CHAPTER_4_DJANGO_FORMS[1] [Read-Only].pptx
PDF
OpenCms Days 2015 Modern templates with nested containers
PPT
Drupal Workshop
PDF
Django Admin (Python meeutp)
PPTX
Cascading style-sheet-
PPT
Chapter 4a cascade style sheet css
PPTX
gdg Introduction to HTML-CSS-Javascript.pptx
Tips and Tricks for Getting the Most out of Views
Drupal for Non-Developers
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8
Drupalcamp
Active Tags and Taxonomy Views Drupal Drop In November 2010
Streamlined Drupal 8: Site Building Strategies for Tight Deadlines
The panels family
SharePoint 2010 for Devs
The Missing Modules
Lesson 15
Drupal Cafe №5 Харьков. Drupal 7 Views 3.
Hillel of Greater Philadelphia Web Training (8/09)
DrupalCamp Florida 2015 - One Content Type to Rule Them All
CHAPTER_4_DJANGO_FORMS[1] [Read-Only].pptx
OpenCms Days 2015 Modern templates with nested containers
Drupal Workshop
Django Admin (Python meeutp)
Cascading style-sheet-
Chapter 4a cascade style sheet css
gdg Introduction to HTML-CSS-Javascript.pptx
Ad

More from DrupalSib (20)

PDF
SSO авторизация - Татьяна Киселева, DrupalJedi
PDF
XML в крупных размерах - Михаил Крайнюк, DrupalJedi
PPTX
BigPipe: ускоряем загрузку страниц - Давид Пашаев, DrupalJedi
PDF
Drupal в школе - Борис Шрайнер
PDF
Евгений Юдкин - Коммуникационные инструменты в отделе продаж на примере интег...
PDF
D8 - Serialize, Normalize - Михаил Крайнюк, DrupalJedi
PDF
Drupal - создание инсталляционных профайлов - Иван Абраменко, CimpleO
PDF
Вадим Валуев - Искусство ИТ
PDF
Migrate drupal 6 to drupal 8. Абраменко Иван
PDF
Entity возрождение легенды. Исай Руслан
PDF
возводим динамическую таблицу, No views, no problem. Крайнюк Михаил
PDF
Реализация “гибких” списков Жамбалова Намжилма
PDF
Петр Селфин. Шок! Drupal 8 против SEO?! Без регистрации и SMS скачать бесплатно
PDF
Сергей Синица. Разработка интернет-магазинов на Drupal
PDF
Eugene Ilyin. Why Drupal is cool?
PDF
Anton Shloma. Drupal as an integration platform
PDF
Руслан Исай - Проповедуем Drupal разработку
PDF
Сергей Черебедов - Integration Drupal with NodeJS. What is it and why You nee...
PDF
Ринат Ибрагимов - Региональное SEO: продвижение сайтов, созданных на  Drupal
PDF
Константин Осипенко - Аутсорс услуг тестирования - реальность или вымысел?
SSO авторизация - Татьяна Киселева, DrupalJedi
XML в крупных размерах - Михаил Крайнюк, DrupalJedi
BigPipe: ускоряем загрузку страниц - Давид Пашаев, DrupalJedi
Drupal в школе - Борис Шрайнер
Евгений Юдкин - Коммуникационные инструменты в отделе продаж на примере интег...
D8 - Serialize, Normalize - Михаил Крайнюк, DrupalJedi
Drupal - создание инсталляционных профайлов - Иван Абраменко, CimpleO
Вадим Валуев - Искусство ИТ
Migrate drupal 6 to drupal 8. Абраменко Иван
Entity возрождение легенды. Исай Руслан
возводим динамическую таблицу, No views, no problem. Крайнюк Михаил
Реализация “гибких” списков Жамбалова Намжилма
Петр Селфин. Шок! Drupal 8 против SEO?! Без регистрации и SMS скачать бесплатно
Сергей Синица. Разработка интернет-магазинов на Drupal
Eugene Ilyin. Why Drupal is cool?
Anton Shloma. Drupal as an integration platform
Руслан Исай - Проповедуем Drupal разработку
Сергей Черебедов - Integration Drupal with NodeJS. What is it and why You nee...
Ринат Ибрагимов - Региональное SEO: продвижение сайтов, созданных на  Drupal
Константин Осипенко - Аутсорс услуг тестирования - реальность или вымысел?

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Understanding_Digital_Forensics_Presentation.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
KodekX | Application Modernization Development
PDF
Approach and Philosophy of On baking technology
PDF
cuic standard and advanced reporting.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
A Presentation on Artificial Intelligence
Advanced methodologies resolving dimensionality complications for autism neur...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Big Data Technologies - Introduction.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Understanding_Digital_Forensics_Presentation.pptx
The AUB Centre for AI in Media Proposal.docx
KodekX | Application Modernization Development
Approach and Philosophy of On baking technology
cuic standard and advanced reporting.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Machine learning based COVID-19 study performance prediction
Empathic Computing: Creating Shared Understanding

Андрей Юртаев - Mastering Views

  • 2. Session plan Interface overview: ● Most of UI elements Examples: ● Agregation ● Contextual filters ● Theming ● Admin pages ● Overriding pages output Sorry, no cats :(
  • 4. Views data types ● Comments ● Content ● Content revisions ● Files ● Taxonomy terms ● Users ● D7: Theme engine ● D8: Custom block ● D8: Custom block revisions ● D8: Log entries
  • 6. Views Displays ● Attachment ● Block ● Feed ● Page ● D8: Embed ● D8: Entity reference
  • 7. Format and Show Format: ● Grid ● HTML List ● Table ● Unformatted list ● D7: Jump menu Show: ● Content ● Fields ● D8: Search results Important thing: Grouping field
  • 9. Filters Important things: ● Exposed filters ● Exposed form settings Useful module: Better Exposed Filters
  • 10. Sort
  • 12. Header, Footer and No results Important things: ● Unfiltered text ● View area ● D8: Rendered entity ● D7 module: Views block area View with no results: Filter: Nid = 0
  • 13. Pager Good alternatives: ● Views Infinite Scroll ● Views Load More
  • 16. Other Important things: ● AJAX ● Query settings: ○ Disable SQL rewriting ○ Distinct
  • 17. Views and Displays Important things: ● Clone views ● Export/Import views ● Clone displays ● Overriding displays Translate views: Internationalization Views
  • 19. Generated content Taxonomy: Genres Content type: Author ● Name (Title): Text ● Bio (Body): Long text Content type: Book ● Title: Text ● Description (Body): Long text ● Author (D7 module: Entity reference) ● Genre: Term reference
  • 20. Aggregation View name: Books by genres Data type: Content, Book Display: Page Display format: HTML list, fields Use aggregation: Yes Field: Genre, Group results together Field: Genre, Count
  • 21. Contextual filters View name: Author info Data type: Content, Book Display: Block Display format: unformatted list, fields Field: Author, Rendered entity Contextual filter: Node ID, Provide default value - Content ID from URL Place block Author info: Only for content type - Book
  • 22. Replacement tokens in Header Clone Taxonomy term Display format: unformatted list, fields Fields: Title, Body Relationship: Genre Field: Term description, Exclude from display Header: Unfiltered text, Use replacement tokens from the first row
  • 23. Theming View name: Books grid view Data type: Content, Book Display: Page Display format: unformatted list, row class - col-xs-12 col-sm-6 col- md-4 Uncheck Add row classes Add to theme: views-view--books- grid-view .tpl.php - <div class="view-content"> + <div class="view-content row"> <?php print $rows; ?> </div>
  • 24. Admin pages View name: Books admin Data type: Content, Book Display: Page Path: admin/content/books Display format: table Menu: Menu tab, Management Field: Title, etc. Field: Draggableviews: Content Field: Draggableviews: Weight Sort criteria: Draggableviews: Weight Extra module: DraggableViews Useful modules: ● Views Bulk Operations ● Commerce Backoffice
  • 25. Overriding default page output by View For texonomy term pages: Path: taxonomy/term/% Contextual filter: tid, Provide default value - Taxonomy term ID from URL Or module Taxonomy display For user pages: Path: user/% Contextual filter: uid, Provide default value - User ID from URL
  • 26. Overriding node output by View View name: Book Display: Page Path: does not meter, something like book/% Contextual filter: nid, Provide default value - Content ID from URL, Override title - %1 Add to theme: node--book.tpl.php - print render($content); + print views_embed_view('book', 'page', $node->nid);
  • 27. Overriding node output by View page 2 Field: Body, Exclude from display Field: Author, Exclude from display Field: Custom text <div class="row"> <div class="col-xs-12 col-sm-8">[body]</div> <div class="col-xs-12 col-sm-4">[field_author]</div> </div>
  • 28. Summary Views is great tool for: ● Node layout (instead Display Suite) ● Page layout (instead Panels) ● Awesome search (with Search API) ● Products catalog (with Drupal Commerce) ● DrupalCamp site :)
  • 29. Thank You! Questions? Gold sponsorWith support Silver sponsors