I’m using Grav Blog Site Skeleton and the Add Page By Form plugin.
My form page for creating blog item:
title: 'Создать новость' pageconfig: parent: /blog include_username: true overwrite_mode: false pagefrontmatter: template: item title: 'My new Blog post' hero_classes: 'text-light title-h1h2 overlay-dark-gradient hero-large parallax' hero_image: road.jpg show_sidebar: true show_breadcrumbs: true show_pagination: true taxonomy: category: blog tag: - journal - guest form: name: addpage.blogpost fields: - name: author label: Автор type: text - name: title label: Заголовок type: text - name: content label: 'Текст сообщения' type: textarea size: long classes: editor - name: images label: 'Загрузить изображение' type: file multiple: false accept: - image/jpeg destination: '@self' random_name: true - name: honeypot type: honeypot buttons: - type: submit value: Опубликовать process: - addpage: null - redirect: /blog
When creating a new item through the “Add Page By Form” plug-in, a random image is created in the blog page, a sample: “\pages\01.blog\new-item\p5tcqgycawmvpzo.jpg”.
I had a problem with the parameter “hero_image: .jpg”. How to open an image with any name found in the blog folder “\pages\01.blog\new-item\ .jpg”.
template: item title: 'New Item' hero_classes: 'text-light title-h1h2 overlay-dark-gradient hero-large parallax' hero_image: road.jpg show_sidebar: true show_breadcrumbs: true show_pagination: true taxonomy: category: blog tag: - journal - guest username: '' author: 'Autor Aaa' images: - name: qbofci7urivvfmt.jpg type: image/jpeg size: 66722 path: /user/pages/01.blog/new-item/qbofci7urivvfmt.jpg