Kooboo / CMS

Old Kooboo CMS, Use Kooboo/Kooboo instead.
http://www.kooboo.com
Other
337 stars 222 forks source link

Request to extend the functionality of Kooboo CMS 'Media Library' #311

Open MarkSizer opened 9 years ago

MarkSizer commented 9 years ago

Feature request:

When adding media to the 'Content \ Media Library' area of Kooboo CMS, it would be useful to add configurable meta data for each file.

For example, when displaying a piece of media from the media library onto a web page using the <img> tag, it is useful to include attributes for "alt", "title", "width" and "height". With perhaps the last two being calculated / provided by the CMS?

It would also be useful to apply a category to images, allowing queries such as "all pictures in the 'cat' category". Also supporting tree-structure categories as content folders currently do.

Ideally, I would be able to do something along the lines of:

@var mediaItems = MediaLibrary.CreateQuery().WhereFolder("PicOfTheDay").WhereBetween("Date", [start-date], [end-date]).WhereContains("title", "silly").Category("cat").SelectRandom(2);
<h2>Two random silly Cat pictures each day!</h2>
foreach(var mediaItem in mediaItems) {
  <img src="@item.Resize(130,100)" alt="@item.title" width="130" height="100" title="@item.Title" role="thumbnail" />
  <img src="@item.Url" alt="@item.title" width="@item.width" height="@item.height" title="@item.Title" role="main" />
}
Godoy commented 9 years ago

:+1: The same here, I have had the need to incorporate image attributes as "nested forms": http://forum.kooboo.com/yaf_postst2562_Create-a-management-news-with-possibility-to-insert-images.aspx#post8642

To do advanced queries with images try create images as a content type. Do relation "Embed Folder" or "Category Folder" to get a rich business logic.