Skip to content

Latest commit

 

History

History
176 lines (140 loc) · 2.9 KB

file-formats.md

File metadata and controls

176 lines (140 loc) · 2.9 KB

File Formats

This module currently supports the following file formats:

  • YAML (default)
  • JSON

YAML

Flattened format

Set a configuration value for the default scope:

general/store_information/name:
  default:
    0: 'Example'

Set a configuration value for website scope:

# Store view scope -> "Example Store-ID 1"
general/store_information/name:
  websites:
    1: 'Example Website'

Set a configuration value for store scope:

# Store view scope -> "Example Store-ID 1"
general/store_information/name:
  stores:
    1: 'Example Store'

Set a configuration value for store scope but with store view code instead of store view ID:

# Store view scope -> "Example with store-view code"
general/store_information/name:
  stores:
    my_store_code: 'Example Store'

Set a configuration value for different scopes in one go:

# Set values for default scope, website scope and store view scope in one go
general/store_information/name:
  default:
    0: 'Example'
  websites:
    1: 'Example Website'
  stores:
    1: 'Example Store DE'
    2: 'Example Store EN'

Hierarchical format

Instead of using the flattened approach above, you can also use the hierarchical format to set a configuration value:

general:
  store_information:
    name:
      default:
        0: 'Example'
      websites:
        1: 'Example Website'
      stores:
        1: 'Example Store DE'
        2: 'Example Store EN'

JSON

Flattened format

Set a configuration value for the default scope:

{
  "general/store_information/name": {
    "default": {
      "0": "Example"
    }
  }
}

Set a configuration value for website scope:

{
  "general/store_information/name": {
    "websites": {
      "1": "Example Website"
    }
  }
}

Set a configuration value for store scope:

{
  "general/store_information/name": {
    "stores": {
      "1": "Example Store"
    }
  }
}

Set a configuration value for store scope but with store view code instead of store view ID:

{
  "general/store_information/name": {
    "stores": {
      "my_store_code": "Example Store"
    }
  }
}

Set a configuration value for different scopes in one go:

{
  "general/store_information/name": {
    "default": {
      "0": "Example"
    },
    "websites": {
      "1": "Example Website"
    },
    "stores": {
      "1": "Example Store DE",
      "2": "Example Store EN"
    }
  }
}

Hierarchical format

Instead of using the flattened approach above, you can also use the hierarchical format to set a configuration value:

{
  "general": {
    "store_information": {
      "name": {
        "default": {
          "0": "Example"
        },
        "websites": {
          "1": "Example Website"
        },
        "stores": {
          "1": "Example Store DE",
          "2": "Example Store EN"
        }
      }
    }
  }
}