Fixtures

Component ID

1722102

Component name

Fixtures

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

The fixtures module imports content created in YAML files. Nodes, menu items, taxonomies and other initial content are created as a batch.

At this point the menu system and nodes are implemented, but require improvement and support for custom fields. This is a work in progress.

Example in sites/all/fixtures/menu.main-menu.yaml:

custom-menu:
  title: Custom menu
  description: A custom menu, used for main navigation
  items:
    item-about-me:
      title: About me
      link: general
      items:
        item-general:
          title: General
          link: general
        item-resume:
          title: Resume
          link: resume
          description: A single-line description

Prerequisites

The Libraries module must be installed together with the Spyc library in the folder sites/all/libraries (or subsite folder). Spyc is a loader/dumper library for YAML.

If you want to import the basic content, move the files in the examples folder to sites/all/fixtures folder. Edit them to match your specific needs and run the command drush fixtures-all

In a later stage, a batch will run, converting this structure to a drupal menu. Same with nodes, taxonomies, etc. ...

Other features are: batch, features integration, drush integration, using entities to export the content to YAML, ...