Giter Club home page Giter Club logo

Comments (14)

kyoshino avatar kyoshino commented on May 26, 2024 1

Just tested locally.

  1. It seems images are scanned so these appear in the Asset Library.
  2. But, when looking for a specific image, the CMS fails to find it under a subdirectory.

I think images under a subdirectory that is not configured in any media_folder (in your case, both /assets/images/ and /assets/heroes/) should be ignored because there is no way to upload images there through the CMS UI. So, not 2 (what you see) but 1 is a bug. I’ll fix it.

from sveltia-cms.

kyoshino avatar kyoshino commented on May 26, 2024 1

Basically, these subfolders cannot be used until I fix this known issue mentioned in README:

Sveltia CMS currently doesn’t support field-specific media_folder and public_folder that are mentioned as the image widget’s beta feature in the Decap CMS doc.

from sveltia-cms.

samtrion avatar samtrion commented on May 26, 2024 1

Please do not put yourself under any time pressure. I can certainly manage without the preview, at least for a certain amount of time. Since I've managed without UI for several years now. 🤣

from sveltia-cms.

kyoshino avatar kyoshino commented on May 26, 2024 1

1 has been solved in d24fd76 and 2 is currently an expected behaviour, so I don’t see further work here. Field-specific media_folder and public_folder are already on my to-do list.

from sveltia-cms.

kyoshino avatar kyoshino commented on May 26, 2024

How the media_folder and public_folder for the posts collection look like? As the Decap doc says, you need these properties for the collection:

    path: '{{slug}}/index'
    media_folder: ''
    public_folder: ''

I’m testing now — one entry contains an image from the global asset folder, and another contains an image from an entry-relative path, and both displays fine:

image
image
image

But I’ve realized that, currently when I select a new image from the image selector, the preview becomes empty. (Once saved, it will be displayed.) It’s a different bug; I’ll fix it.

image

from sveltia-cms.

kyoshino avatar kyoshino commented on May 26, 2024

The problem here is the saved path is actually relative, e.g. heroes/package-manager.jpg. It should start with / if the image is coming from the global media folder.

from sveltia-cms.

kyoshino avatar kyoshino commented on May 26, 2024

One more note: Sveltia CMS currently doesn’t support field-specific media_folder and public_folder that are mentioned as the image widget’s beta feature in the Decap CMS doc. So I think there is no way to use /heros/ only for the specific hero image field while other image fields use /assets/.

from sveltia-cms.

kyoshino avatar kyoshino commented on May 26, 2024

But I’ve realized that, currently when I select a new image from the image selector, the preview becomes empty. (Once saved, it will be displayed.) It’s a different bug; I’ll fix it.

This bug is now fixed. I’m closing the issue as it seems like a configuration problem.

from sveltia-cms.

samtrion avatar samtrion commented on May 26, 2024

Hi @kyoshino,
I'm afraid it's indeed a bug. I've taken a detailed look at the issue and managed to achieve partial success. My global settings is media_folder: /assets/ and public_folder: /. Collection settings remain unchanged with media_folder: '' and public_folder: ''.

Under the directory /assets/, there are two subfolders /assets/images/ and /assets/heros/.

With these settings, neither images nor heroes are displayed.

  • If I update the global setting to media_folder: /assets/images/ and public_folder: /images/, images are displayed, but heroes are not.
    image
    image

  • If I update the global setting to media_folder: /assets/heros/ and public_folder: /heros/, heroes are displayed, but images are not.
    image
    image

from sveltia-cms.

kyoshino avatar kyoshino commented on May 26, 2024

I think that behaviour is expected.

Collection settings remain unchanged with media_folder: '' and public_folder: ''.

Then images are expected to be in the relative paths.

  • If I update the global setting to media_folder: /assets/images/ and public_folder: /images/, images are displayed, but heroes are not.

Then images under /assets/heros/ are not scanned.

  • If I update the global setting to media_folder: /assets/heros/ and public_folder: /heros/, heroes are displayed, but images are not.

Then images under /assets/images/ are not scanned.

from sveltia-cms.

samtrion avatar samtrion commented on May 26, 2024

But when I set my global settings to

media_folder: /assets/
public_folder: /

Both subfolders should be scanned or not?

from sveltia-cms.

samtrion avatar samtrion commented on May 26, 2024

But when I set my global settings to

media_folder: /assets/
public_folder: /

Both subfolders should be scanned or not?

As side note, with the fix #115 (comment), both path prefixes /images/ and /heros/ are working well in markdown fields and the preview.

from sveltia-cms.

kyoshino avatar kyoshino commented on May 26, 2024

Basically, these subfolders cannot be used until I fix this known issue mentioned in README

I cannot provide an ETA for this, unfortunately.

from sveltia-cms.

samtrion avatar samtrion commented on May 26, 2024

Reopen for further tracking?

from sveltia-cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.