How Can We Help?
< All Topics
Print

Cloning a View in Drupal: A Step-by-Step Guide

a) How do I copy a view in Drupal ?

1. First, navigate to Structure and select Views (Admin/Structure/Views) in the Manage administrative menu. Find the Vendors view and click Duplicate in its drop-down button.

drupal

2. Then, name the duplicateRecipes” and click Duplicate. The view configuration page appears.

3. After that, click on the vendors in the title field, then change it to “Recipes” and click Apply.

drupal

4. Next, click on the Table under Format field to change the table format to grid format. A pop-up window will appear where you can check the grid and apply the style options, leaving default values, and click Apply.

5. Then, click Content: Body under Fields to keep only the title and image fields for the Recipe view. Click Delete in the pop-up window that appears.

6. After that, click on content type (=vendor) to change the content type filter under filter conditions to use the recipe content type. In the Configure Filters: Content: Type popup, check Recipe, and uncheck Vendor. Click Apply.

7. Next, click the Add button under Filters, search for “ingredients“, and checkingredients (field_ingredients)”. Click Add and configure filter criteria.

8. Then, a pop-up window appears with additional vocabulary and selection type settings. Click Apply, then expose the filter to visitors by filling in the fields and clicking Apply.

Field name Explanation Example value
The filter should be made visible to visitors, allowing them to modify it. Allow visitors to filter and search. Checked
Required Whether a value must be provided Unchecked
Label The label for this filter is displayed on the view page.
Find recipes using…

drupal

9. After that, click on “/vendors” in the Path field under Page Settings and change the Path Label field to “Recipes.” In the pop-up window that appears, enter the pathrecipes” and click Apply.

10. Next, click “Normal: Vendors” in the “Menufield under “Page Settings” to change the menu link title, and then change the title to “Recipes” in the popup and click Apply.

11. To enhance filtering and paging speed, use AJAX. Under Advanced > Other, click No in the Use AJAX field, then checkUse AJAX” in the popup window and click Apply.

12. After that, click Save to save the view.

13. Finally, return to the home page and click on the recipe in the navigation to view a new recipe.

drupal

Table of Contents