forkcms icon indicating copy to clipboard operation
forkcms copied to clipboard

Media Library: Add title/caption/description/alt to MediaItem

Open jeroendesloovere opened this issue 6 years ago • 17 comments

Type

  • Feature

Problem description

When creating a media gallery, you can add images. Sometimes you feel the need to have the option to add a description to every image. Which can then be used in for example a Carousel. => This is currently not possible (and most of us create a Banner module to tackle this problem).

Example: Title + Description + Link to the specific page. schermafbeelding 2018-02-16 om 11 02 28

Expected behavior / Proposed solutions

We should add a button to every image, which opens a pop-up, where we can change the "text". schermafbeelding 2018-02-16 om 11 03 54

What would be user friendly:

  • A way of showing that the image contains "text".

Note: this will add a database field to MediaGroupMediaItem

To Do:

  • [x] Integrate in MediaLibrary MediaItemEdit with multi-language support:
    • [x] Title
    • [x] Caption
    • [x] Alt text
    • [x] Description
    • [x] Link
  • [x] Integrate in MediaLibraryHelper for MediaGroups

jeroendesloovere avatar Feb 16 '18 10:02 jeroendesloovere

My suggestion:

  • title “text” field
  • description “text” field
  • link “text” field - you can add your url here

jeroendesloovere avatar Feb 20 '18 09:02 jeroendesloovere

Currently MediaGalleries are language-unaware. Which makes my following question: => do it needs to be possible to add title/description/link for every language... f.e.: in a tabbed modal?

jeroendesloovere avatar Feb 20 '18 09:02 jeroendesloovere

@mathiashelin @Katrienvh are there other sliders that you would prefere for this over bootstrap slider? Or other feedback/requests

carakas avatar Feb 20 '18 09:02 carakas

@carakas The sliders part is not something that this feature should tackle. This issue goes about adding "title"/"description"/"link" to the MediaGroupMediaItem.

Another PR will add bootstrap carousel: https://github.com/forkcms/forkcms/pull/2470

jeroendesloovere avatar Feb 20 '18 09:02 jeroendesloovere

take a look at wordpress screen shot 2018-02-20 at 11 20 59

I would use the same fields

carakas avatar Feb 20 '18 10:02 carakas

@carakas Thanks for your reply, but you are talking about something else.

MediaItem

=> This is were you are talking about.

  • Currently we have a title field.

MediaGroupMediaItem

=> This is where I am talking about. A MediaGroup contains multiple MediaItem entities. Because your MediaItem can be connected in multiple MediaGroup, you must be able to add different information...

We want to be able to provide a MediaGroupMediaItem with a custom

  • title
  • description
  • link So we don't need any additional Banner modules any longer.

jeroendesloovere avatar Feb 20 '18 10:02 jeroendesloovere

I think you are starting to make it too complicated if this is the thing you are trying to do

carakas avatar Feb 20 '18 10:02 carakas

No no no, this is a huge one.

Example On the home page of a website you need a slider, where you want to show some "news items"/"product foto's"/... each one should have a title/subtitle/ and a clickthrough to the detail page.

This is currently not possible in Fork CMS. Unless you create your own module which will work with FileUploads... (too cumbersome)

That's why my feature PR would be to add these three fields, so this can be achieved.

jeroendesloovere avatar Feb 20 '18 10:02 jeroendesloovere

Use case examples: schermafbeelding 2018-02-20 om 11 44 15

schermafbeelding 2018-02-20 om 11 44 57 schermafbeelding 2018-02-20 om 11 44 31

jeroendesloovere avatar Feb 20 '18 10:02 jeroendesloovere

and why wouldn't you do that on the top level? like I suggested?

carakas avatar Feb 20 '18 11:02 carakas

Hmmm, I have thought about it for some hours... Ok, I'll do that.

jeroendesloovere avatar Feb 20 '18 12:02 jeroendesloovere

So:

  • Title (will be used in caption)
  • Subtitle (will be used in caption)
  • Alt (will be used in HtmlDOMElement)
  • Description (where will this be used??? @carakas, also in caption?)
  • Link (which will be used as href in <a> read more)

jeroendesloovere avatar Feb 20 '18 12:02 jeroendesloovere

@jeroendesloovere check how wordpress handles it

carakas avatar Feb 20 '18 13:02 carakas

Found on https://codex.wordpress.org/Media_Library_Screen

  • Title – The name of the media. A title is often shown on attachment pages and galleries if themes or plugins are designed to display it. F.e.: "Sunset"
  • Caption – A brief explanation of the media. F.e.: "Orange sea with sunset"
  • Description – An explanation of this particular media. F.e.: "Place: Okinawa Beach"
  • Alt Text – (Image files only) The alt text for the image, e.g. “The Mona Lisa” to describe the media. Used for accessibility. F.e.: "Sunset No. 1"

jeroendesloovere avatar Feb 20 '18 14:02 jeroendesloovere

Progress so far in the MediaLibrary Image: schermafbeelding 2018-02-21 om 10 58 05 File: schermafbeelding 2018-02-21 om 10 58 26

jeroendesloovere avatar Feb 21 '18 09:02 jeroendesloovere

wouldn't it be better to use an editor or textarea for the caption and description?

carakas avatar Feb 21 '18 10:02 carakas

I just changed the following:

  • caption and description now have TextareaType
  • captionLink added (Adding a CaptionLink has the advantage that the frontender can do anything with it.) schermafbeelding 2018-02-21 om 13 22 03

@carakas What do you think of this?

jeroendesloovere avatar Feb 21 '18 12:02 jeroendesloovere