OpenWGA 7.6 - TMLScript reference

TMLContext "this"
Method :

meta([type,] name)

On object TMLContext "this"
Usage Returns the value of a metadata field
Description This is the TMLScript pendant to WebTML tag <tml:metadata>. It will return metadata fields of diverse types. You can use the same values for types as you can on attribute "type" of the mentioned tag. If you omit the type it will assume type "content".

While the method itself is available in all TMLScript scripts the types "profile", "session" and "request" will only return values in a web environment.

A shortcut syntax is available for metadata fields of type "content", which is documented on the TMLContext object itself.

Unlike the tag <tml:metadata> this method cannot be used to retrieve WebTML taginfos. Use method this.taginfo instead.

This method only returns single values of metadata fields. If it is used to retrieve metadata fields that contain lists it will only return the first element of the list. To retrieve the whole list use method this.metaList() instead.
Parameters type (String, optional):
Type of the metadata fields. See WebTML metadata fields for valid values. Defaults to "content".

name (String, optional):
Name of the metadata field. See WebTML metadata fields for valid values.
Return value Single value of the metadata field
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Examples Retrieving the title of the context document:

return meta("title")


Retrieving the statistics field "hits" from the user profile:

return meta("profile", "hits")