OpenWGA 7.6 - WebTML reference

WebTML tags » image

<tml:image item ="item-name">

Purpose:

Load and saves informations for an image file to display to/from an item

Description:

With this attribute it is possible to determine an image file to display by the value of an item. When inside OpenWGA content manager, the <tml:image> tag with item attribute provides an editor which enables the author to choose an image to be displayed from various sources. Information about the chosen file  is stored in an item with the given name.

Upon normal rendering the <tml:image> tag then uses the information stored in the specified item to display the image.

The information stored inside the item is called an image link. This is a complex value of varying format. To interpret it without using <tml:image> you can use the WGA Service API "de.innovationgate.wgpublisher.webtml.utils.ImageLinkReader" in TMLScript which will read the item value and provide you with clear information about the image being displayed and its container.

Value(s):

Name of an item to store/read the information to/from

Examples:

A simple <tml:image> tag storing and retrieving image data from an item "imageitem":

<tml:image item="imageitem"/>

Reading an image link with the "ImageLinkReader" Service API:

var reader = WGA.service(Packages.de.innovationgate.wgpublisher.webtml.utils.ImageLinkReader);

var imageLink = reader.read(itemList("imageitem"));

log.info("File: " + imageLink.getFile());

log.info("Document: " + imageLink.getDoc());

log.info("Database: " + imageLink.getDb());