Media Library Functionality

I’m really digging the Ghost Platform so far but I’m having trouble adjusting from WordPress given Ghost’s lack of built-in media library functionality, similar to Wordpress.

Is there some way that I could potentially integrate this media library functionality into Ghost, using an integration or plugin?

7 Likes

Here’s a similar discussion – TL;DR, media library is a little bit more complexed to add into the system at that point, but there are a few ways (mainly through external integrations) where you can implement some sort of media control.

2 Likes

I think, Ghost CMS’s worst side is this. Media Library. We have to upload and upload again the same images. May be I can would like to use older image for future posts. Why I need to upload again for new post? Yes this is complex but they say " We’ve raised $5,000,000 " . I am happy an open source project provide to gain money but 7 years left and 5 million dollars gained so there is no media library. I think this feature is a milestone. I hope this will be added in the near future.

5 Likes

@fakruzaruret I understand and agree. Here is some more related discussion:

1 Like

I agree with you.

2 Likes

That’s good to know that it works but OMG that’s such a horrendous hack. I wish we could just upload assets to an image gallery and be able to reference them. :frowning:

3 Likes

I migrated a site off the maven network via Wordpress into Ghost and I can tell you that the hardest part of the migration was having to work with the image library. Tedious. Not fun.

I don’t have many repetitive visual elements in my Ghost site – thechocolatelife.com – so for me, snippets were/are the way to go.

What I did was create a draft post with all of the common elements, upload my library images, then assign them to snippets. This means I can add a library element to the current post using the /name convention without having to focus attention away from writing.

So much faster and easier, and I learned that having a naming convention provides assistance in navigating the snippets by arranging common elements in groups in the / dropdown.

2 Likes

Hello @Jam @itsmingjie @fakruzaruret @denvergeeks @biapar @csgeek @TheChocolateLife

A team developed a prototype to have a native and visually appealing file and media manager. Especially adapted to a blog content manager, which is already wonderful as Ghost, but it would be even more wonderful to have such a feature.

Hopefully you can give visibility to the proposal (giving your support with votes or with comments about it within the proposal).

Link in Ghost Forum: Prototype: New File Management

Best regards.

1 Like

@khalil.io Where can I find information about the team?

3 Likes

Is there more to the prototype than this image?

4 Likes

We created our own Media (Documents/Images/Videos) Library at .

I’ll see if we can release it as Open Source.

5 Likes

Any news on this? Sounds very promising.

4 Likes

Hello everyone,

I recently started checking about ghostjs as my wife wanted to build a website to showcase her work with photography. I hosted a ghost instance in the free tier of fly.io (for personal reasons) and one of the first things I noticed was the lack of file management.

So, after checking a bit online, the forum and seeing the posts like this one, I decided to start implementing the feature myself. Here on this link you can see a preview of how it looks like (UI is a little bit different from the mocks above hehe).

Demo Video: ghostjs-demo-file-mgt.mov - Google Drive

There are some important aspects, at the moment, on how it is working. But ofc, everything is fully open for debate and that’s the main reason I am posting it here.

  • Currently, only images added to pages/posts are tracked
  • As soon as the image is uploaded in a post, it will be linked to it
  • If an image is removed from a post, as soon as the post is saved (automatically or manually) it will be unlinked
  • If an image is deleted from the file manager, it will be removed from all posts (without leaving a broken image on it)
  • Images that are unlinked are not deleted automatically, it will only show as linked to “0 posts”
  • A hash is created from the image content, so, if you upload the exact same image multiple times, only the 1st one will be stored in the server

There are a lot of things that I would like to do, like:

  • Migration of old posts, to create the file entity and link to them during upgrade
  • A way to see in which posts the image is being used
  • Delete images in bulk, maybe pre-selecting them all
  • Edit image details that would reflect the alt/description across all posts (since usually, a description of an image rarely changes when it is used multiple times)
  • Replacing an image with another one and it would reflect in all posts
  • A way to select an image from the gallery when editing a post
  • Unit tests hehe :P

There are several things still missing to code (and test), but I hope to get some early feedback from you all and see what do you think. :)

Ah, btw, I introduced some very few features during this process. One of them for example is the ability to load images of different sizes by their “key” (not only their width/height value).

Instead of “/content/images/size/w256h256/2024/03/example-1.jpg”
You can do “/content/images/size/thumbnail/2024/03/example-1.jpg”

5 Likes

Hello again,

Just posting a little update, with all file types supported (audio, video, documents, images)

They all reflect the post that they’re being used, and when deleted, the post’s equivalent widget goes back to the “empty” state, or if it’s a gallery, the image is removed from it and the rest are left untouched.

Example:

From:

To:

5 Likes

Hello again @marceloadsj , amazing all the progress. Many congratulations and encouragement to be able to complete this necessary function in a CMS as powerful as Ghost.

Responding and commenting a little on progress:

Group A (developed parameters):

  • a1. I think with the last update you managed to integrate all file formats.
  • a.2./ a.3 / a.5. Perfect. The linking and unlinking logic you are working on seems to me to be the most convenient to avoid tedious processes of doing it manually.
  • a.4.1. When deleting an image from the file manager it would be ideal to be able to choose from which post it would be deleted. A kind of checklist.
  • a.4.2. I also think it is important that even if a file/image is embedded in a single post, when deleting the post that a check is generated to delete post+resources or uncheck to keep the resources and not delete them from the server.
  • a.5. I think this hash function is essential, it avoids duplicity and the possibility of linking an image that is already on the server including its hash directly.

Group B (things you would like to do):

  • b.1. / b.3. Ideal for managing files.
  • b.2. / b.4. / b.5 / b.6 Maybe this idea is linked to (a.4 / a.5), a kind of file detail where you can set the parameters you mention, but also have the possibility to replace the file and have its hash kept with the original one.

Group C (some points that would be interesting to see):

  • c.1. Add files directly in the file manager. Important feature to manage a lot of images and resources that were in quantity.
  • c.2. Tools to filter files. Either by type, size, by post, etc.
  • c.3. To have a folder view.
  • c.4. To have the possibility of generating a compressed file type ZIP or TAR.XZ, this thinking about the backup from the administration GUI and its later restoration without having to go through the terminal and to make a ghost backup.

Prototype for a.4.1

Prototype for a.4.2

2 Likes

Hey @khalil.io, thanks a lot for your reply and sharing your feedback, it will definitely help me understanding the optimal approach to implement. :slight_smile:

I will check the items you mentioned and reply along the way.

[b.3] I am right now implementing the migration process, so we can retroactively link posts/files when someone migrates to this new version.

Btw, regarding the differences in UI/UX between the implementation and the prototypes you shared, let me add one more item to the TODO list so I can tackle it later. I really liked your proposal and with your help I’m sure we can achieve it.

3 Likes

Just leaving a little update here:

The migration scripts seems to be finished hehe. :slight_smile:

It scans all posts, reading the lexical, creating all files in the database (which will later be displayed in the File Manager), and also linking the files with respective posts.

A good “side-effect” is being able to see broken images via File Manager. Images/Files that were deleted from the server but are still linked to posts.

:)

To keep everyone up to date, I will start working on the “file detail” screen/modal which will allow us to tackle items b.2, b.4, b.5, b.6!

5 Likes

Aloha, small update of the day. The item I mentioned earlier, regarding the file edit screen/modal is still in WIP, but in the meantime…

I created the functionality to export a zip file of all your images/media/files. :slight_smile: I also added files/posts_files table to the exported json (but I still didn’t test importing it yet)

During week days is harder for me to work on it, so, I might only reply next weekend. Have a good week ahead everyone!

4 Likes

Best solution. One question: once migrated to this file manager solution how compatible are the posts with respect to a native Ghost one? That is, are the files linked to the posts incompatible with a non-file manager version?


Great side effect hahaha, great and very useful.


Let me know if you need anything, I am ready to help. All the advances are extraordinary.

As for me, I’ll keep working on some prototypes in detail and I’ll revisit the new aesthetics Ghost has in these latest versions which has slight differences.

A great week to you @marceloadsj :grinning: .

2 Likes

Today I was told by one of the ghost team that a file manager is not in high demand???

Is that really the case?

4 Likes