Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import a view in Drupal?

How I can Import a view to Drupal. I have an exported view that I need to import in a different Drupal Installation. I don't have an import option in the admin/structure/views?

Thanks!

Edit:

I have found the solution. I have to log in as user 1 to get this option.

like image 800
perpetual_dream Avatar asked Nov 28 '11 12:11

perpetual_dream


People also ask

How do I import a view into Drupal 8?

Just follow the below steps for import/export a view in drupal 8. Goto configuration(admin/config). There under the development section we can find “configuration synchronization”, click on it(admin/config/development/configuration).

Where are views in Drupal?

Go to the “Views settings” page under /admin/structure/views/settings and check the “Show the SQL query” option of the “Live preview settings.” Then you can go to any view and upon clicking the “Update preview” button you will see the SQL query issued by Drupal.

What is a Drupal view?

The views module allows administrators and site designers to create, manage, and display lists of content. Each list managed by the views module is known as a "view", and the output of a view is known as a "display". Displays are provided in either block or page form, and a single view may have multiple displays.


2 Answers

For D7, if you don't want to use user #1, you can enable the 'PHP filter' core module, and then give the relevant user role the 'Use PHP for settings' permission. Users with this role will then see an 'import' link next to the 'Add new view' link on the views admin page. Or you can go to the import page directly on /admin/structure/views/import

like image 174
VictoriaChan Avatar answered Sep 20 '22 13:09

VictoriaChan


I have just discovered another reason this can happen - the Paranoia module being enabled. If enabled, /admin/structure/views/import will display "You are not authorized to access this page", even if you are logged in as UID1.

Cool module. If it's enabled, you won't see it in the admin interface, even if you're logged in as UID1. You'll need to disable it with drush dis paranoia or setting the status of it to 0 in the system table.

like image 36
siliconmeadow Avatar answered Sep 22 '22 13:09

siliconmeadow