Git Product home page Git Product logo

drupal-fixtures's Introduction

Drupal Fixtures

This is a fork from Tom Verhaeghe's Fixtures project at http://git.drupal.org/sandbox/heartdriven/1722102.git

Fixtures is an idea derived from other frameworks - in this case Symfony and Ruby on Rails. Fixtures are a YAML way of writing default content for your website. If you create your Drupal based website with Fixtures, you might need a set of default testing data to populate your site once you've installed it.

Features enables you to create your website from a "clean-build path", instead of the classic "upgrade path" approach. This way, continuous integration is possible. This creates a little problem: every time you do a clean install of your drupal website, you have to create content again and again. Fixtures is a way to permanently create content in a text file, and the user doesn't have to know a lot about drupal.

USER FIXTURES

Imports users. The following file should be written in the sites/all/fixtures folder.

user.yaml

MENU FIXTURES

Define a menu tree in a file in the folder sites/all/fixtures and use the naming convention below:

menu--[machine-name].yaml menu--main-menu.yaml menu--other-menu.yaml

Important: note that if you specify menu items, you'll have to run them after nodes/taxonomies have been created. Menu items created with a path that doesn't exist yet are not saved.

NODE FIXTURES

Below is a description of the node fixtures.

node--[type].yaml node--[type]--[custom-name].yaml

node--article.yaml # Any articles node--article--batch1.yaml # "Batch" 1 of articles node--article--batch2.yaml # node--page.yaml # All pages, not part of any category node--page--about.yaml # For example all pages that are under the "About" menu item node--page--contact.yaml #

RUN FIXTURES

Use drush to run the fixtures. The command is 'drush fixtures-all' and it currently imports users, nodes and menus.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.