Code Monkey home page Code Monkey logo

config_modify's Introduction

Config Modify

This module allows other modules to define changes to installable configuration in a config/modify folder.

Usage

This module will try to apply modifications whenever Drupal core would apply config from config/optional.

Modification Format

Modifications are defined in YAML files in the config/modify folder of your module. Files must be named <module>.<unique>.yml where <module> matches the name of your module and <unique> is a unique string (e.g. add_search_field).

The files contain two top-level keys: dependencies and items. The contents of dependencies matches Drupal core's config dependency format. items should contain a list of named config items using the Config Update Definition format from the update_helper module.

All configuration keys under items are implicit config dependencies, providing for atomic updates.

For example to add an article field to a search index:

dependencies:
  config:
    - field.field.node.article.body
items:
  search_api.index.my_search:
    expected_config: { }
    add:
      field_settings:
        article_body:
          label: Article Contents
          datasource_id: 'entity:node'
          property_path: body
          type: text
          dependencies:
            config: field.field.node.article.body

The above file will automatically add an article_body field to the my_search index when the search index exists and the body field exists on the article node type. If the search index or the field does not exist it will do nothing.

config_modify's People

Contributors

kingdutch avatar tiagosimoes-euf avatar

Watchers

Damiano Fossa avatar  avatar groszgabor avatar

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.