Drush Views

Uit De Vliegende Brigade
Ga naar: navigatie, zoeken

Met de Drush View-module kun je met views werken vanaf de command line. Tijdens installatie is er maar één submodule om te activeren. Installatie:

drush en -y drush_views

Commando's:

  • views-list
  • views-import
  • views-export - Alias: vwex
  • views-delete
  • views-copy-options
  • views-displays
  • views-theme-functions

drush views-export

  • Alias: vwex
  • De optie --taget-path krijg ik niet aan de praat.

drush help views-export levert op:

Usage: drush [options] views-export <views>

Export the specified views to single .view files.
<views> should be a comma-separated list. For example: view1,view2,view3.
If <views> is omitted, all views are exported.

Available options:
--target-path=TARGET_PATH
  Store exported views in the TARGET_PATH directory.
  If omitted, the default path export/views is used.
--status=<enabled|disabled>
  Filter by status: export only enabled/disabled views.
--tag=tag1,tag2,...
  Filter by tag: export only views with the given tag(s).
--output=<files|includes|bulk>
  Output format:
  * 'files' (default) exports to individual .view files;
  * 'includes' exports to individual .inc PHP files that can be included by
     hook_views_default_views().
  * 'bulk' exports to STDOUT, in a format suitable for inclusion in a
    .module file.
--module=<module>
  When in 'bulk' output mode, name the hook in a suitable way for inclusion
  in a module with the given name. Default: MYMODULE.

Aliases: vwex

drush views-import

  • Alias: vwim
drush help views-import

Usage: drush [options] views-import <views>

Import the specified views.
Existing views will be deleted, or overridden if they are default views.
<views> should be a comma-separated list of files, with an optional
.view extension. For example: file1,file2,file3.
If <views> is a directory, all *.view files it contains will be imported.
If omitted, the default path export/views is used.

Aliases: vwim