About Templates

Spriter uses a simple template system to allow more flexibility in how CSS and HTML content is generated for your project.

Template Properties

Each template can be customized in the following ways:

TextSpecifies the text of the template. Special keywords can be embedded which are replaced with an appropriate value.
Repeat Mode

Specifies how the template is repeated in relation to image sprites.

Once onlyThe template only appears once in the generated context.
One for each spriteThe template is repeated once for every sprite in the project.

Template Variables

The following tables lists the supported variable replacement values.

The variables below can be used in any repeat mode:

{spritefilename}The filename of the current sprite sheet, relative to the project file
{fullspritefilename}

The full filename of the current sprite sheet

{cssfilename}The filename of the CSS document export, relative to the project file
{fullcssfilename}The full filename of the CSS document export
{date}The current date and time in UTC
{appname}The name of the application generating the content
{appversion}The version of the application generating the content
{thumbnailwidth}The width of preview thumbnails
{thumbnailheight}The height of preview thumbnails
{name}The filename of the project, excluding path and extension
{filename}The filename of the project
{fullfilename}The full path and filename of the project

The variables below can only be used for templates which are repeated for each sprite in the project:

{classname}The name of the CSS class associated with the sprite. This includes any class specific prefixes and suffixes, but not outer prefixes/suffixes.
{fullclassname}

The name of the CSS class associated with the sprite. This includes all prefixes and suffixes.

{imagex}The X position of the sprite in the sprite sheet.
{imagexunit}The unit representing the position of the sprite in the sprite sheet. Currently always "px" (pixels).
{imagey}The Y position of the sprite in the sprite sheet.
{imageyunit}The unit representing the position of the sprite in the sprite sheet. Currently always "px" (pixels).
{imagewidth}The width of the sprite.
{imagewidthunit}The unit representing the size of the sprite in the sprite sheet. Currently always "px" (pixels).
{imageheight}The height of the sprite.
{imageheightunit}The unit representing the size of the sprite in the sprite sheet. Currently always "px" (pixels).
{imagefilename}The filename of the sprite, relative to the project file. For sprites automatically created as part of an effect, this will return the filename of the original image the sprite is based upon.
{fullimagefilename}The full filename of the sprite. For sprites automatically created as part of an effect, this will return the filename of the original image the sprite is based upon.
{imagefolder}The folder where the sprite is located.

See Also

Working with templates