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

Filepicker: broken previews when streams are used #3767

Open
u07 opened this issue Nov 3, 2023 · 3 comments
Open

Filepicker: broken previews when streams are used #3767

u07 opened this issue Nov 3, 2023 · 3 comments

Comments

@u07
Copy link

u07 commented Nov 3, 2023

As the docs say, we can use theme:// in filepicker. But it does not work as intended.

image
image
image
image

@pamtbaau
Copy link
Contributor

pamtbaau commented Dec 4, 2023

@u07, Please do not use images to explain an issue (see Stackoverflow for reasons) and preferably provide:

  • a verbal explanation of the problem. "But it does not work as intended." does not quite describe the problem.
  • a short reproducible case showing the issue

Using a fresh install of Grav+Admin v1.7.43, I do not find anything that is "not working as intended".

My setup:

  • Fresh install of latest Grav+Admin v1.7.43
  • Added a filepicker field to blueprint /user/themes/quark/blueprints/default.yaml
    header.picked_image:
      type: filepicker
      folder: 'theme://images'
      label: Select a file
      preview_images: true
      accept:
        - .png
        - .jpg
    
  • Added extra image windows background.jpg to folder /user/themes/quark/images
  • Admin shows the following field:
    image
  • When picking a file and saving the page, the frontmatter of the page looks as follows:
    ---
    title: Typography
    picked_image: 'windows background.jpg'
    ---
    

@u07
Copy link
Author

u07 commented Dec 4, 2023

@pamtbaau, thanks for taking a look into this issue. As you succeeded getting previews working, I should conclude that some details are important for reproducing this.

For now, the only difference I see is that you are modifying a theme blueprint, while I was working with a flex objects blueprint. There is one named Contacts, coming with Grav as an example.

I'll provide a step by step later because of vacation, no pc here.

@pamtbaau
Copy link
Contributor

pamtbaau commented Dec 4, 2023

@u07, Can't reproduce the issue either using flex-objects...

My setup:

  • Fresh install of latest Grav+Admin v1.7.43
  • In Admin edit config of plugin Flex-Objects and enable 'Contact' directory
  • Copied folder /user/plugins/flex-objects/data/flex-objects to folder /user/data
  • Copied file /user/plugins/flex-objects/blueprints/flex-objects/contacts.yaml to /user/blueprints/flex-objects/contacts.yaml
  • Added a filepicker field to form section in blueprint /user/blueprints/flex-objects/contacts.yaml
    picked_image:
      type: filepicker
      folder: 'theme://images'
      label: Select a file
      preview_images: true
      accept:
        - .png
        - .jpg
    
  • Added extra image windows background.jpg to folder /user/themes/quark/images
  • Admin shows the following field when editing a Contact flex-object
    image
  • When picking a file and saving the contact, the contact in /user/data/flex-objects/contacts.json looks as follows:
      "gizwsvkyo5xtms2s": {
          "published": true,
          "first_name": "David",
          "last_name": "Tucker",
          "email": "dtucker0@tripod.com",
          "website": "http:\/\/flavors.me",
          "tags": [
              "Puce",
              "Teal"
          ],
          "picked_image": "windows background.jpg"
      },
    

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

2 participants