Watch videos with subtitles in your language, upload your videos, create your own subtitles! Click here to learn more on "how to Dotsub"

Duplicating a View

0 (0 Likes / 0 Dislikes)
Duplicating a View with Blake Hall This tutorial covers creating a new page by duplicating an existing view. By the end of this tutorial, you’ll know how to create a page listing recipes by duplicating the existing Vendors view from our Anytown Farmers Market site. We’ll also modify the page, so that the recipes are displayed in a grid and can be filtered by ingredients. Before you get started with this tutorial, you’ll probably want to make sure you understand the main concepts and parts that make up a view, know how to create a view from scratch. Your site also needs the vendor and recipe content types created, each of them with main image fields. It would also be a good idea to have a couple of recipe content items created. The Vendors view must also exist already. See the written version of this tutorial for links to each of these prerequisites if any of them sound unfamiliar. From our Anytown Farmers Market site, we’re going to navigate to the View administration page by clicking on Structure and then Views. From the Views administration screen, we’re going to find the Vendors view, click on the drop-down, and click Duplicate. We’re going to name this duplicate view Recipes. Once we change the name of this view to Recipes and click Duplicate, the View configuration page appears. To change the title of the view page to Recipes, click Vendors in the Title field. In the Title pop-up, we’re going to change Vendors to Recipes, and click Apply. To change this view from a table to a grid format, we’re going to click Table in the Format field. From the Format pop-up window, we’re going to select Grid, and then click Apply. After clicking Apply, we get the Style options pop-up window. From here, we’re going to retain all of the default values, so we can just click Apply. As far as the fields in our view, we only want to retain the Title and Image fields for our Recipes view. So, under the field listing, we’re going to click Content Body under Fields, and then we’re going to click Remove from the body pop-up. To change the content type filter to use the recipe content type, click on Content Type = Vendor under the filter criteria. We’ll change this from using Vendor to the Recipe content type and click Apply. To add another filter that is exposed to visitors, we’ll click Add in the Filter criteria section. From the Filter criteria pop-up, we’re going to search for ingredients, and we’re going to check the field_ingredients line, and click Add and configure filter criteria. This pop-up offers you the ability to choose which vocabulary and drop-down type we’re going to use for the ingredients filter. We’re going to use the defaults and click Apply. This next pop-up allows you to expose this filter to visitors. We’re going to allow visitors to change this filter, so we’ll check the Expose this filter checkbox. We’re also going to make sure that this filter isn’t required, so that box should be unchecked. The label we want to use for this filter is Find recipes using... so we’ll add that to the label field and then we’ll click Apply. To change the path this view will be available at from Vendors, we’ll click on the path labelled Vendors under Page Settings. In the pop-up that appears, we’ll change this from Vendors to Recipes and click Apply. It’s worth noting that when you’re editing a view, you enter paths without the leading slash, unlike other administrative pages, such as when you provide a path to a content item page. To change the menu-linked title, we’ll choose Normal Vendors under Page Settings. In the pop-up that appears, we’ll change this link title from Vendors to Recipes and then we’ll click Apply. In order to use AJAX to make filtering and paging faster for our users, under Advanced in Other, click on No where it says Use AJAX. In the pop-up that appears, we’ll check the checkbox that says Use AJAX and click Apply. With these changes in place, we’re ready to save our view. With our Recipe view saved, we’re ready to go back to the homepage. Now we can see our Recipes menu item that’s been added, so we can click Recipes and the navigation to view our Recipe view planning page. In this tutorial, we duplicated the Vendors view and changed its configuration in order to display recipe content items to our users. We also added an exposed filter to our view so that users can search for recipes by ingredients.

Video Details

Duration: 4 minutes and 13 seconds
Country: United States
Language: English
License: All rights reserved
Genre: None
Views: 1
Posted by: drupalizeme on Feb 1, 2018

Duplicating a View

Caption and Translate

    Sign In/Register for Dotsub above to caption this video.