November 12, 2010
How to use the Version Control and Bulk Export features of Views
This "how to" focuses on the bulk export and version control functionality of the Views module. The following steps document how to export multiple views at once and create a module from the exported code that will allow you to revert any subsequent changes to your views.
- You know how to install and enable a module
- You have views you want to bulk export; we'll call them myView1 and myView2
- Views (specifically 6.x-2.x)
1) Install Views 2 and enable (/admin/build/modules) the following modules: Views, Views exporter, Views UI
2) Navigate to the Views Administration page (admin/build/views)
- You should have "Edit | Export | Clone | Delete" options next to myView1 and myView2. Once we're done, "Delete" will become "Revert"!
3) Navigate to the Bulk Export page to export myView1 and myView2. Click Tools > Bulk Export or browse to admin/build/views/tools/export.
4) Export myView1 and myView2
- Check the boxes to the left of myView1 and myView2
- Choose a module name: my_views
- Click Export
5) Create a module from the exports
$ cd sites/all/modules
$ sudo mkdir my_views
$ cd my_views
- Create the following files, paste in the appropriate code, and place them into the my_views directory:
my_views.module (add a my_views.views_default.inc (add a
6) Clear the cache (just to be safe!)
- Navigate to admin/settings/performance > Clear cached data
6) Enable the my_views module (admin/build/modules)
- the module name should be "my_views Export Module"
7) Navigate to the Views Admin page (admin/build/views) Verify that you now have version control abilities for myView1 and myView2.
- The right of these should now read "Edit | Export | Clone | Revert"
Posted by kkwaiser at November 12, 2010 12:40 PM