Media
purpose
Enables media (images, videos) content management for DOM nodes in the template.
usage
Add data-ffMedia attribute to any DOM node in the template.
<figure data-ffMedia></figure>
<figure data-ffMedia='{"file":"../static/logo.svg","width":300}'></figure>
<img data-ffMedia='{"as":"src"}'>
options
{
"file" : null, // filename of to a specific media-file to show. defaults to ffContent::getFirstThumb()
// if a relative path notation is used, it points to a path relative to the template file
"width" : null, // width of the media. defaults to width of source file (for all options see ffThumb)
"height" : null, // height of the media. defaults to height of source file (for all options see ffThumb)
"scalemode" : "fill", // scalemode of the thumb (for all options see ffThumb)
"as" : "html", // the output-mode of the thumb (for all options see ffThumb::call())
// if "src" or "data" is used, thumb will be injected as src=""-attribute
// if "backgroundImage" is used, the thumb will be injected as background-image in the style attribute
"htmlAttributes" : {}, // html attributes (for videos: {"controls":false, "autoplay":true, "muted":true, "loop":true, "playsinline":true})
"edit" : false, // injects front-end editing widget
"namespace" : null // Defines by filename, which mediafile is being chosen
// If a string is given, the filename needs to start with this string
// If an array is given, the filename needs to match the following pattern:
// prefix [0], [suffix [1], [name [2]]]
}
08 April 2024