Drupal/C2/Displaying-Contents-using-Views/Gujarati

From Script | Spoken-Tutorial
Revision as of 21:37, 2 September 2016 by Bharat636 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Time Narration
00:01 Welcome to the Spoken tutorial on Displaying Contents using Views.
00:07 In this tutorial, we will learn about:
  • Views
  • A page with teaser and
  • A simple block view.
00:15 To record this tutorial, I am using:
  • Ubuntu Linux Operating System
  • Drupal 8 and
  • Firefox Web browser.

You can use any web browser as per your choice.

00:31 First let us learn about Views.
  • Views is used for displaying a collection of similar content
  • Views can be displayed in various formats, such as -
00:43
  • Tables
  • Lists
  • Gallery etc.
00:49 It can select, order, filter, and present our contents based on the criteria we define.

Views are essentially Reports or Query Results as known in other software.

01:04 For example, if you go to a library and ask the librarian for a stack of books with the following criteria:
  • published before 1905
  • whose authors last name starts with “M”
01:19 * where the book has 100 or more pages and * the covers are red.
01:25 You will be sent out of the library for asking that. But in Drupal, it can be done very easily with Views.
01:34 We have a simple 5-step process for setting up our Views. The workflow of Views is-
  • Choose your Display
  • Set your Format
01:45
  • Figure out your Fields
  • Apply a Filter and then
  • Sort the results.
01:53 Now, let’s learn to create the standard Views on a simple Drupal site.
01:53 Now, let us open our website which we created earlier.
01:58 Let’s learn to create the standard Views on a simple Drupal site.
02:04 Click on Structure, and then click on Views.
02:09 Drupal has many built-in Views. For example - the Content View allows administrators to administer the content.
02:20 Same thing with Custom block library, Files, Frontpage, People, Recent comments, Recent content, Taxonomy terms, Who’s new and Who’s online.
02:37 These are all Views that come with Drupal which we can update or edit.
02:44 First, we will create a simple page with Teasers. It will be a landing page for our Events Content type.
02:54 Click Add new view and let’s name it as "Events Sponsored".
03:02 Change the Content of type from All to Events and sorted by as Newest first.
03:11 Click Create a page. Leave Display format as Unformatted list of teasers.
03:20 This is because we’ve already set up the Teaser mode in our Manage display.
03:26 Check Create a menu link.Then under the Menu drop-down, choose Main navigation.
03:35 This will help us to see all the Events that we have added to our site.
03:41 Click Save and edit. Now we have access to the screen that we mentioned in the introduction.
03:51 This screen displays a Page whose Format is an Unformatted list of Teasers.
03:59 We don’t need any fields here because we have set up our Teaser mode.
04:05 The FILTER CRITERIA is Published events. And the SORT CRITERIA is the publication date in descending order.
04:16 If we scroll down, we can see a quick preview here.
04:21 If you don’t like this, it’s simple to change. We’ll cover that in another tutorial.
04:28 For now, let us click on Save. Click on Back to site.
04:35 We have a new tab in the main menu called Events, with a listing of all of our Events.
04:44 Here are all the Event logos with different shapes and sizes.
04:50 We have the Event Website and the Event Date.
04:55 Remember, we can update this in our Teaser mode for the Events Content type, if we want to change it.
05:04 That’s it! This is the landing page for all of our Events.
05:09 One of the key features in Drupal is the ability to place information

in the Block regions or sidebars of our website.

05:19 Previously, if we added a new Event, we would have to come out on the sidebar on every page that it’s on, and update the sidebar.
05:31 Now, Views updates our content automatically.
05:36 Click on Structure and then on Views.
05:41 Since we’re coming back here a lot, let’s add it to our shortcuts by clicking the star. Now click on Add new view.
05:53 In the View name, type: "Recent Events Added" . This’ll be a list of the latest Events we’ve added to our site.
06:04 Now, change Content of type from All to Events.
06:09 Choose Create a block. Leave the sorted by as Newest First.
06:18 In Block title, type: "Recently Added Events", just to show that we can have a different name and title.
06:28 Drupal allows us to create different styles of Views. We’ll leave this as an Unformatted list of titles, with 5 Items per block.
06:40 Don’t check Use a pager. If we do, we will get page numbers like Page one of three, two of three, etc., at the bottom of our block.
06:53 Click Save and edit. Let’s look at our preview. It displays a list of titles of the most recently added Events.
07:05 Here, we can see that it displays a Block. FORMAT is an Unformatted list. FIELDS are the Title fields.
07:16 And the FILTER CRITERIA is the Published Events in descending order of their publication date.
07:24 Let’s click Save. This will not show up anywhere because we haven’t placed the block yet.
07:33 Click on Structure and Block layout. Let’s place the block in the Sidebar first region.
07:43 Click on Place block. When we scroll down, we can see the block called Recent Events Added. Click Place block.
07:54 Since we haven’t learnt about blocks in detail yet, we will just click Save for now. It will show up on every page. We will edit that later.
08:06 It’s going to appear in the order after Search. Click Save blocks.
08:13 Click Back to site. And, we have a new block on every page that gives us the most recently added Events on our site.
08:24 There’s no need to configure this again. You can place it wherever you want and it will always be up-to-date.
08:33 So, that’s an example of a Block view using our Events Content type in publication date order.
08:42 With this, we come to the end of this tutorial.
08:46 Let us summarize. In this tutorial we have learnt about:
  • Views
  • A page with teaser and
  • A simple block view.
09:01 This video is adapted from Acquia and OSTraining and revised by Spoken Tutorial Project, IIT Bombay.
09:12 The video at this link summarizes the Spoken Tutorial project. Please download and watch it. The Spoken Tutorial Project team conducts workshops and gives certificates. For more details, please write to us.
09:29 Spoken Tutorial Project is funded by NMEICT, Ministry of Human Resource Development and

NVLI, Ministry of Culture Government of India.

09:42 This is Varsha Venkatesh, signing off. Thanks for joining.

Contributors and Content Editors

Bharat636, Jyotisolanki