Free-Conversant Support / imageResource Macro
 Home   About Conversant   Free Sites   Hosting   Support   XML-RPC 

Search



Documentation >> Macros >> imageResource

Macro: imageResource

Usage:

<!--#imageResource rezId="[resource id]"-->

Overview:

Returns an img tag expanded from the original resource.

The difference between this macro and just using the |resource| itself is that the macro allows all of the attributes of the resource to be overridden (except for the src attribute, which is the actual location of the image). The most common uses for this resource are to resize (change the height or width) or realign (left, right, etc.) the image versus what is set in the resource.

Required Attributes:

  • rezId="[string]": the id (name) of the resource to be processed

Optional Attributes:

These optional attributes are exactly the same as the attributes visible in the resource editor. They produce attributes in the <IMG> tag that is created when the resource is expanded. You can read more about these attributes in the W3C documentation for the IMG tag.

  • src
  • URL - if set, the img tag is wrapped with a link pointing to this URL
  • target - if URL is set, then target becomes the target attribute of the link wrapping the IMG tag
  • align
  • alt
  • border
  • height
  • width
  • hspace
  • vspace
  • id
  • class
  • style
  • title
  • ismap
  • usemap
  • onclick
  • ondblclick
  • onmousedown
  • onmouseup
  • onmouseover
  • onmousemove
  • onmouseout
  • onfocus
  • onblur
  • onkeypress
  • onkeydown
  • onkeyup
  • onselect
  • onchange

Examples:

We have a resource named "Conversant Badge" which expands to this:

Notice that the image is a link pointing to the signup page on free-conversant. That was done by setting the resource's "URL" attribute.

Here's how we'd use the #imageResource macro to display the image without a link, and align it to the right. For good measure, we'll throw in the onmouseover and title attributes.

<!--#imageResource rezId="Conversant Badge" url="" align="right" title="Look at the status bar!" onmouseover="window.status=window.defaultStatus='Display this badge with pride!'" onmouseout="window.status=window.defaultStatus=''"-->

Which is expanded to this:

View in DG