OpenWGA 7.6 - TMLScript reference

TMLContext "this"
Method :

contentURL([mediakey, layoutkey [, ignoreVirtualLink]])

On object TMLContext "this"
Usage Returns a URL to the content document in context
Description This command returns a URL that points to the content document currently in context and which uses the configured URL generation scheme for this database (i.e. creates title path URLs if configured to do so).

Per default this URL also displays the document with the layout of it's content type. Use the parameters to choose a different layout for output.
Parameters mediakey (String, optional):
Mediakey of the WebTML module that should be used as outer layout for the document. Specify null or leave out to render it with its content types layouts.

layoutkey (String, optional):
Name of the WebTML module that should be used as outer layout for the document. Specify null or leave out to render it with its content types layouts.

ignoreVirtualLink (Boolean, optional):
If true and the context document is virtual this method returns a normal URL to the virtual document instead of the virtual target URL. Defaults to false.
Return value A URL which displays the content document with the given outer layout (String)
Allowed in script types
  • WebTML pages and normal WebTML actions
Examples Simple call to return a standard URL to the context document:

this.contentURL();


Rendering a document with another layout, using WebTML module "preview" of media key "html":

this.contentURL( "html", "preview" );


You may also just specify a different media key if you want the document to be displayed in its content type layout, but in a differing media type:

this.contentURL( "pdf", null );