Web Oriented Object Framework

User Guide (Version 0.4)

line separator

Using Images

Linking to images is done through the include_image controller method. This method generates <img> tags based on either URL's or file names. For example, within a template, the following will generate a <img> tag:

[my include_image http://www.images.com/some/external/image.png alt "external URL"]

As will this:

[my include_image some/local/image.png alt "URL relative to Woof root"]

Or this:

[my include_image image.png alt "Local file name"]

These examples show the various targets for the links.

  • An absolute URL, as in the first example,
  • A relative URL, which is treated as the file path under the public/images subdirectory.
  • A file name, which will be located as described in the Locating Static Resources chapter with public/images as the search root.

Image attributes

Any additional attributes to be added to the <img> tag can be passed to include_image as additional arguments or as a single dictionary argument. For example,

[my include_image image.png alt "Image description" class "imgclass"]

and

[my include_image image.png {alt "Image description" class "imgclass"}]

will have the same effect.

Woof! Version: 0.4, Server: Apache, Interface: CGI, Tcl: 8.6b1.1