Tag library reference for the following tag libraries:
Media tag library
Namespace definition: xmlns:media="http://net.sourceforge.openutils/mgnlMedia"
EL Functions
Tagfiles
Required attributes are marked with a*
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String desc(info.magnolia.cms.core.Content)
Get the description from a media, given the media node itself.
<c:set var="mediaNode" value="${media:node(content.image)}" />
<c:out value="${media:desc(mediaNode)}" />
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String descLoc(info.magnolia.cms.core.Content, java.util.Locale)
Get the description from a media, given the media node itself and a locale. Try to get the value from nodedata "description-{locale}"; if not found get the value from "description-en"; if not found again, get the value from "description".
<c:set var="mediaNode" value="${media:node(content.image)}" />
<c:out value="${media:descLoc(mediaNode, pageContext.request.locale)}" />
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.Integer height(info.magnolia.cms.core.Content)
Returns the height of the *original* media, if availableFunction class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: net.sourceforge.openutils.mgnlmedia.media.lifecycle.MediaModule module()
Get the media module instance.
<c:set var="player" value="${media:module().player}" />
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: info.magnolia.cms.core.Content node(java.lang.Object)
Load a node from the media repository, given the UUID of the media node.
<c:set var="mediaNode" value="${media:node(content.image)}" />
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String preview(info.magnolia.cms.core.Content)
Get the url to the preview (l45x350 resolution) for a given media node (image or flv/youtube preview)
<c:set var="mediaNode" value="${media:node(content.image)}" />
<img src="${pageContext.request.contextPath}${media:preview(mediaNode)}" />
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.Object property(info.magnolia.cms.core.Content, java.lang.String)
Returns a property (nodeData) of the media, given the media Content and the property nameFunction class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String[] resolutions(info.magnolia.cms.core.Content)
Get all the resolutions for a given media node.
<c:set var="mediaNode" value="${media:node(content.image)}" />
<c:forEach var="res" items="${media:resolutions(mediaNode)}">
<img src="${pageContext.request.contextPath}${media:urlres(mediaNode, res)}" />
</c:forEach>
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: int[] size(info.magnolia.cms.core.Content, java.lang.String)
Get the real size of a resolution for a given media node (image or flv/youtube preview). Parameters are the media node and a resolution. You can use 'original' as resolution to get the size of the original image
<c:set var="mediaNode" value="${media:node(content.image)}" />
<c:set var="size" value="${media:size(content.image, 'original')}" />
<img src="${pageContext.request.contextPath}${media:url(mediaNode)}" style="width:${size[0]};height:${size[1]}" />
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String[] tags(info.magnolia.cms.core.Content)
Get the tags from a media, given the media node itself.
<c:set var="mediaNode" value="${media:node(content.image)}" />
<c:forEach var="tag" items="${media:tags(mediaNode)}">
<c:out value="${tag}" />
</c:forEach>
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String[] tagsLoc(info.magnolia.cms.core.Content, java.util.Locale)
Get the tags from a media, given the media node itself and a locale. Try to get the value from nodedata "tags-{locale}"; if not found get the value from "tags-en"; if not found again, get the value from "tags".
<c:set var="mediaNode" value="${media:node(content.image)}" />
<c:forEach var="tag" items="${media:tagsLoc(mediaNode, pageContext.request.locale)}">
<c:out value="${tag}" />
</c:forEach>
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String thumbnail(info.magnolia.cms.core.Content)
Get the url to the thumbnail (l100x100 resolution) for a given media node (image or flv/youtube preview)
<c:set var="mediaNode" value="${media:node(content.image)}" />
<img src="${pageContext.request.contextPath}${media:thumbnail(mediaNode)}" />
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String title(info.magnolia.cms.core.Content)
Get the title from a media, given the media node itself.
<c:set var="mediaNode" value="${media:node(content.image)}" />
<c:out value="${media:title(mediaNode)}" />
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String titleLoc(info.magnolia.cms.core.Content, java.util.Locale)
Get the title from a media, given the media node itself and a locale. Try to get the value from nodedata "title-{locale}"; if not found get the value from "title-en"; if not found again, get the value from "title".
<c:set var="mediaNode" value="${media:node(content.image)}" />
<c:out value="${media:titleLoc(mediaNode, pageContext.request.locale)}" />
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String type(info.magnolia.cms.core.Content)
Get the media type for a given media node
<c:set var="mediaNode" value="${media:node(content.image)}" />
<c:if test="${media:type(mediaNode) eq 'image'}">
<img src="${pageContext.request.contextPath}${media:url(mediaNode)}" />
</c:if>
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String url(info.magnolia.cms.core.Content)
Get the url to the media, given the media node itself
<c:set var="mediaNode" value="${media:node(content.image)}" />
<img src="${pageContext.request.contextPath}${media:url(mediaNode)}" />
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String urlParams(info.magnolia.cms.core.Content, java.util.Map)
Get the url to the media, given the media node itself and an options map
<c:set var="mediaNode" value="${media:node(content.image)}" />
<img src="${pageContext.request.contextPath}${media:url(mediaNode, optionsMap)}" />
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String urlres(info.magnolia.cms.core.Content, java.lang.String)
Get the url to the resolution for a given media node (image or flv/youtube preview) The resolution string has the following pattern [controlChar][width]x[height][;param_key1=param_value1,param_key2=param_value2,...] The controlChar identifies which resize method will be used:
<c:set var="mediaNode" value="${media:node(content.image)}" />
<img src="${pageContext.request.contextPath}${media:urlres(mediaNode, "o200x300")}" />
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String[] usedInWebPages(info.magnolia.cms.core.Content)
Get list of path to content nodes of website repository in which the given media node is used
<c:set var="mediaNode" value="${media:node(content.image)}" />
<c:forEach var="page" items="${media:usedInWebPages(mediaNode)}">
<a href="${pageContext.request.contextPath}${page}">${page}</a>
</c:forEach>
Function class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.Integer width(info.magnolia.cms.core.Content)
Returns the width of the *original* media, if availableFunction class: net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl
Function signature: java.lang.String getUrl2(info.magnolia.cms.core.Content, java.util.Map)
@deprecated use urlParams()
<media:media id="myMedia" item="${content.image}" />
<media:swfobject player="jwplayer5" width="${width}" height="${height}" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" flashvars="${flashvars}" />