Version 4 (modified by, 8 years ago) (diff)


Using Views

Many of use the views module in Drupal. We have established a special way to work with views through our revision control system. You should not need to edit any custom view on a live site. *Note: Editing default views will require a different process (*We need to decide on protocol for this.*).

Views UI

You can use the views user interface to edit or create views in your development environment. The process for editing a view is somewhat different from creating a new view.

Creating a New View

When creating a new view, there are a few things to remember.

  1. It is a good practice to name your view based on the site for which it's created. We have not been consistent about this, but it would be a good idea to use ussf_myView, comm_myView, and org_myView for our respective sites.
  2. The most important thing for the ease of revision control is tagging your view (see the red circle). For the site use the tag "ussfhome" - for use the tag "community" and for use the tag organize. This will help us when we export our views.

Creating a new View.

Editing Views

When editing a view, you should see a screen that looks like this:

Editing a view

If you need help editing views, the views documentation is quite helpful. Once you have edited a view to your satisfaction and saved it, check to make sure it has been tagged appropriately. This is done under "View Settings" seen in the image above.

Exporting Your Views

This part of the process is done under the "Tools" tab. You will need to do the following things:

  1. Choose Tools >> Bulk export.
  2. Choose the appropriate site specific tag. In the image the tag name is ussfhome.
  3. Choose the correct module name for the site. This name has already been created. For the module name is "views_ussfhome", for the module name is "views_rev" and for the module name is 'views_comm'.
  4. Click Export.

See the example below:

Views bulk export display.

Final Steps

For this step, you will need to find the views_nameYouUsedAbove module directory, which should be located in yourGitPath/web/sites/all/modules/. In this directory, find the which may be located in the ./includes directory of the module. Once you find and open the file, delete everything in the file except the <?php -- *note this must be in the file for your changes to take effect.*

On the export window of your view that looks like this:

Text field from views export.

Copy all of the text from this textarea and paste it into after the <?php. Save the file, and you should be able to commit your changes per the normal git method.

Attachments (4)

Download all attachments as: .zip