stk:image.create(template)

Creates an image element using stk:image.create-url.

element()?stk:image.create
  1. element()image
  2. xs:string?scaling
  3. xs:booleanscale-up
  4. xs:string?size
  5. xs:stringfilter
  6. xs:string?format
  7. xs:integer?quality
  8. xs:string?background
  9. xs:string?title
  10. xs:string?alt
  11. xs:string?class
  12. xs:string?style
  13. xs:string?id
  14. xs:string*attr

Examples

Input

<xsl:if test="$relatedcontents/content[@key = $image-key]">
    <xsl:call-template name="stk:image.create">
        <xsl:with-param name="image" select="$relatedcontents/content[@key = $image-key]"/>
    </xsl:call-template>
</xsl:if>

Result

<figure>
  <noscript>
    <img alt="Fussball" src="__##CREATE_IMAGEURL&amp;rO0ABXc/AA84Ni9sYWJlbC9tZWRpdW0AG3NjYWxld2lkdGgoMzAwKTtyb3VuZGVkKDQpOwAAAARqcGVnAAI4MAADMTAx##__"></img>
  </noscript>
  <img alt="Fussball" title="Fussball" data-srcset="{&quot;64&quot;:&quot;__##CREATE_IMAGEURL&amp;rO0ABXc9AA44Ni9sYWJlbC9zbWFsbAAac2NhbGV3aWR0aCg2NCk7cm91bmRlZCg0KTsAAAAEanBlZwACODAAAzEwMQ==##__&quot;,&quot;128&quot;:&quot;__##CREATE_IMAGEURL&amp;rO0ABXc+AA44Ni9sYWJlbC9zbWFsbAAbc2NhbGV3aWR0aCgxMjgpO3JvdW5kZWQoNCk7AAAABGpwZWcAAjgwAAMxMDE=##__&quot;,&quot;256&quot;:&quot;__##CREATE_IMAGEURL&amp;rO0ABXc+AA44Ni9sYWJlbC9zbWFsbAAbc2NhbGV3aWR0aCgyNTYpO3JvdW5kZWQoNCk7AAAABGpwZWcAAjgwAAMxMDE=##__&quot;,&quot;512&quot;:&quot;__##CREATE_IMAGEURL&amp;rO0ABXc/AA84Ni9sYWJlbC9tZWRpdW0AG3NjYWxld2lkdGgoNTEyKTtyb3VuZGVkKDQpOwAAAARqcGVnAAI4MAADMTAx##__&quot;,&quot;1024&quot;:&quot;__##CREATE_IMAGEURL&amp;rO0ABXc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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgIsBOG8AAYfmw9wAAAAASUVORK5CYII="></img>
</figure>

Parameters

image
The image content element
Type
element()
scaling
Image scaling filter. See Enonic documentation (image filters) for details
Type
xs:string?
scale-up
if set to false(), the image will not be scaled larger than the original image size
Type
xs:boolean
Default
true()
size
Type
xs:string?
filter
Output image filters. See Enonic documentation (image filters) for details
Type
xs:string
Default
$stk:config-filter
format
Output image format (JPEG, PNG). See Enonic documentation (createImageUrl ) for details
Type
xs:string?
Default
$stk:default-image-format
quality
Quality of image in percent. Only applicable for jpeg format
Type
xs:integer?
Default
$stk:default-image-quality
background
Background color in hex rgb format. See Enonic documentation (createImageUrl ) for details
Type
xs:string?
title
Image title attribute
Type
xs:string?
Default
$image/title
alt
Image alt attribute
Type
xs:string?
Default
$image/contentdata/description or $image/title
class
Image class attribute
Type
xs:string?
style
Image style attribute
Type
xs:string?
id
Image id attribute
Type
xs:string?
attr
Custom attributes. Format: 'foo=bar'. Multiple attributes: 'foo=bar', 'fish=salmon'
Type
xs:string*