Skip to content

Per Collection Media Folder , Images Not Deleted When Post Is Deleted #4069

@goldcoders

Description

@goldcoders

Per Collection Media Folder Always leave the Images Not Deleted...
Therefore It Remained in the Folder and only the index.md is deleted when you delete a post entry.

My Config
- name: "blog"
    identifier_field: title
    label: "Blog"
    label_singular: "Post"
    folder: "exampleSite/content/blog"
    filter: { field: "index", value: false }
    path: "{{slug}}/index" # used for bundled post
    create: true
    media_folder: "resources"
    public_folder: "blog/{{slug}}/resources"
    # show_preview_links must be set to true show preview_path
    preview_path: "blog/{{fields.slug}}"
    editor:
      preview: false
    fields:
      - { label: "Publish Date", name: "date", widget: "datetime" }
      - { label: "Draft", name: "draft", widget: "boolean", default: false }
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Slug", name: "slug", widget: "hidden" }
      - { label: "Description", name: "description", widget: "string" }
      - { label: "Featured Image", name: "featured_image", widget: image }
      - label: Resources
        name: resources
        widget: list
        required: false
        fields:
          - label: "Image"
            name: "src"
            widget: "image"
          - label: "Name"
            name: "name"
            widget: "string"
      - { label: "Content", name: "body", widget: "markdown" }

Is there a possibility to use the CMS EVENTS ?

is there a onDelete event where in you can ask specify to delete also the folder and the image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions