Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to control the foldername of objects #152

Open
Jogai opened this issue Dec 13, 2021 · 0 comments
Open

How to control the foldername of objects #152

Jogai opened this issue Dec 13, 2021 · 0 comments

Comments

@Jogai
Copy link

Jogai commented Dec 13, 2021

I switched to folderstorage, but each directory is named like a hash. If I configure the key to one of my fields it errors on save saying "Failed to save entry: Array to string conversion"

relevant part of my config:

  # Data Configuration
  data:
    # Object class to be used, allowing custom methods for the object
    object: 'Grav\Common\Flex\Types\Generic\GenericObject'
    # Collection class to be used, allowing custom methods for the collections
    collection: 'Grav\Common\Flex\Types\Generic\GenericCollection'
    # Index class to be used, works as a quick database-like lookup index
    index: 'Grav\Common\Flex\Types\Generic\GenericIndex'
    storage:
      # Storage class, use single file storage (does not support images and assets)
      class: 'Grav\Framework\Flex\Storage\FolderStorage'
      options:
        formatter:
          # File formatter class, in this case the file is stored in markdown
          class: 'Grav\Framework\File\Formatter\MarkdownFormatter'
        # JSON file where all the objects will be stored
        folder: user-data://flex-objects/crashes
        # File pattern to generate the filename
        pattern: '{FOLDER}/{KEY}/{FILE}{EXT}'
        # Filename
        file: {key}
        # Field which will be used as {KEY}
        key: crash_id
        # Keep index file in filesystem to speed up lookups
        indexed: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant