1 | This documentation 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. |
---|
2 | |
---|
3 | Assumptions: |
---|
4 | - You have views you want to bulk export; we'll call them <em>myView1</em> and <em>myView2</em> |
---|
5 | - You know how to install and enable a module |
---|
6 | |
---|
7 | |
---|
8 | <ol> |
---|
9 | <li><h3>Modules you will need</h3> |
---|
10 | <p>Install <a href="http://drupal.org/project/views" target="_blank">Views</a> and <a href="base_url:admin/build/modules" target="_blank">enable</a> the following modules: Views, Views exporter, Views UI</p> |
---|
11 | </li> |
---|
12 | <li><h3>Evaluate the Current State of Things</h3> |
---|
13 | <p>Navigate to the <a href="base_url:admin/build/views" target="_blank">Views Administration page</a>. You should have <em>Edit | Export | Clone | Delete</em> options next to <em>myView1</em> and <em>myView2</em>. Once we're done, "Delete" will become "Revert"!</p> |
---|
14 | </li> |
---|
15 | <li><h3>Bulk Export Your Views</h3> |
---|
16 | <ol> |
---|
17 | <li>Click <strong>Tools</strong> > <strong>Bulk Export</strong> to navigate to the <a href="base_url:admin/build/views/tools/exports" target="_blank">Bulk Export page</a> to export <em>myView1</em> and <em>myView2</em>.</li> |
---|
18 | <li>Check the boxes to the left of <em>myView1</em> and <em>myView2</em></li> |
---|
19 | <li>Choose a module name: my_views</li> |
---|
20 | <li>Click Export</li> |
---|
21 | </ol> |
---|
22 | </li> |
---|
23 | <li><h3>Create a Module from the Exported Views</h3> |
---|
24 | <p>The results of the export should now be in front of you. Specifically, the results page should be composed of three code-containing regions. This code and the following steps are all you need to create a module that will allow you to revert your views to the state they were in when you exported them. |
---|
25 | <ol> |
---|
26 | <li>Create a directory called <em>my_views</em> within your sites/all/modules directory.</li> |
---|
27 | <li>Create the following files, paste in the appropriate code, and place them into the <em>my_views</em> directory:</li> |
---|
28 | <ul> |
---|
29 | <li>my_views.info</li> |
---|
30 | <li>my_views.module (add a <?php tag at the beginning of this file!)</li> |
---|
31 | <li>my_views.views_default.inc (add a <?php tag at the beginning of this file!)</li> |
---|
32 | </ul> |
---|
33 | </ol> |
---|
34 | </li> |
---|
35 | <li><h3>Clear the cache</h3> |
---|
36 | <p>Just to be safe. Navigate to the <a href="base_url:admin/settings/performance" target="_blank">Performance Administration page</a> and <strong>Clear cached data</strong>.</p> |
---|
37 | </li> |
---|
38 | <li><h3>Enable the Module Containing Exported Views</h3> |
---|
39 | <p>Navigate to the <a href="base_url:admin/build/modules" target="_blank">Modules Administration page</a> and enable <em>my_views Export Module</em>. <strong>Save</strong>.</p> |
---|
40 | </li> |
---|
41 | <li><h3>Verify Presence of Reversion Option for Exported Views</h3> |
---|
42 | <p>Navigate to the <a href="base_url:admin/build/views" target="_blank">Views Administration page</a>. The right of <em>myView1</em> and <em>myView2</em> should now read <em>Edit | Export | Clone | Revert</em>. Congratulations, you now have version control in place for your exported views!</p> |
---|
43 | </li> |
---|
44 | </ol> |
---|