GameDB2 User Manual - Available Template Tags
Global template tags
The following
Template Tags are available in any
Dynamic and
Static
template.
Some template types or template tags may make available template tags with names identical to these ones; in those cases,
the tags work as specified in the help for those specific template types, instead of as listed here.
<GDBInclude name="templateName" formatted>
This tag allows you to pull in the contents of any
Include template. The <GDBInclude> tag will be
replaced with the current contents of the specified include template. No other processing occurs on the included contents,
so any
Template Tags in the included file will NOT be expanded.
The attribute
name specifies the name of the include template to include; this may be either the short name
for the template, or it's full name.
The
optional attribute
formatted, if present, assumes that the template contains text data formatted
into lines and paragraphs, and converts single line breaks to <BR> tags and double line breaks to <P> tags, so that
the text will display properly. If this attribute is not provided, the text is inserted as is.
<GDBCurrentDate format="xxx">
This tag expands out to the date and time at the time the
template that it is contained in is rebuilt.
The
optional attribute
format is used to format the current date and time to your specifications, according
to the standard C library function
strftime. If this attribute is not specified, the default value is
"%c".
<GDBHasGames namePrefix="xx" newGames saleGames negate>
This conditional tag allows you to test to see if there are any
games currently
registered with the system, optionally matching one or more criteria.
The
optional attribute
namePrefix can be used to determine if there are any
games whose names match the provided criteria. Possible values are:
- * to check for all games (default)
- # to check for games whose names begin with a number
- any letter to check for games whose names begin with that letter
The
optional attributes
newGames and
saleGames allow you to filter
the results to only games that are new or which are flagged as on sale (see
extended game fields for more
information).
The
optional attribute
negate reverses the sense of the test, so that instead
of testing if at least one such game exists, it instead checks to make sure that no such games exist.
If there is (or is not, in the case of
negate) at least one game that matches the criteria provided,
the contents of the container will be expanded out. Otherwise, it is skipped entirely.
<GDBGameCount namePrefix="xx" newGames saleGames>
This tag expands out to be the exact number of
games in the system which match the criteria provided
in the tag attributes. This number may be anywhere from 0 to the total number of games currently registered with the
system.
The attributes for this tag are interpreted the same as the attributes in the
<GDBHasGames> tag.
<GDBGameList namePrefix="xx" newGames saleGames>
This looping tag iterates all of the
games in the system which match the criteria provided
in the tag attributes. The contents of this container will be expanded into the output file once for each
matching game. Based on the criteria provided, it is possible for the container to never be expanded if no
games match. You can guard against this by checking using the
<GDBHasGames> tag.
Each time the contents of the container is expanded out, every tag that is available to
Game Information Templates
is also available to this template, allowing you to obtain any information you desire about the game in question.
The attributes for this tag are interpreted the same as the attributes in the
<GDBHasGames> tag.
<GDBHasCategory namePrefix="xx" negate>
<GDBHasPublisher namePrefix="xx" negate>
<GDBHasDesigner namePrefix="xx" negate>
This tag operates in the same way that
<GDBHasGames> does, except that instead of telling you
if there are any
games, these tags tell you if there are any
Categories,
Publishers or
Designers instead.
The attributes for this tag are interpreted the same as the attributes in the
<GDBHasGames> tag.
<GDBCategoryCount namePrefix="xx">
<GDBPublisherCount namePrefix="xx">
<GDBDesignerCount namePrefix="xx">
This tag operates in the same way that
<GDBGameCount> does, except that instead of expanding out
to the number of
games, these tags expand out to the number of
Categories,
Publishers or
Designers instead.
The attributes for this tag are interpreted the same as the attributes in the
<GDBHasGames> tag.
<GDBCategoryList namePrefix="xx">
<GDBPublisherList namePrefix="xx">
<GDBDesignerList namePrefix="xx">
This tag operates in the same way that
<GDBGameList> does, except that instead of looping over
a list of
games, these tags loop over a list of
Categories,
Publishers or
Designers instead.
Each time the contents of the container is expanded out, every tag that is available to
Category, Publisher and Designer Information Templates is also available to this template, allowing you to
obtain any information you desire about the item in question.
The attributes for this tag are interpreted the same as the attributes in the
<GDBHasGames> tag.
<GDBEventID>
<GDBEventURL>
<GDBEventName>
<GDBEventDescription>
<GDBEventStartDate>
<GDBEventStartTime>
<GDBEventEndDate>
<GDBEventEndTime>
<GDBEventRepeatText>
<GDBGameID>
This tag expands out to the GameDB internal GameID for this
game. This is the number which
uniquely identifies this game to GameDB.
<GDBGameName maxLength="##">
This tag expands out to the name for this game.
The optional attribute maxLength allows you to specify the maximum length that you want this tag to
expand out. When the name of the game is longer than the length provided here, it is truncated to this length and an
ellipsis ("...") is appended to the end.
<GDBGameURL template="xx">
This tag expands out to the complete URL for a page generated for the current game using the template provided.
The
optional attribute
template specifies the template to use when creating the link. The specified
template name must be the full or short name of a Game Information Template. If no such template is found, or if this attribute
is not specified, the default is to select the first template of the appropriate type added and use that.
The template provides the information required to generate the URL for the page to this game. Normally this is used inside
a
static template to provide a link to the full page for a game. However, since multiple templates of the
same type are possible, this may also be used in conjunction with that ability to generate several individual pages for
a game, and link between them.
<GDBGameDescription excerpt="xx">
This tag expands out to the descriptive text entered for this game.
The
optional attribute
excerpt can be used to control how much of the actual
description is written out to the page. Possible values are:
- paragraph to output only the first paragraph.
- sentence to output only the first sentence.
- any number to output only that number of characters.
When this attribute is specified, and the description is truncated as a result, an ellipsis ("...") is
appended to the end of the truncated description as an indication that there is more information.
<GDBGamePlayTime units="xx">
This tag expands out to the expected amount of time it takes to play this game.
The
optional attribute
units allows you to control what units are used to
express the time. Possible values are:
- minutes to display the time as a number in minutes (default)
- hours to display the time in HH:MM format.
<GDBGameMinPlayers>
<GDBGameMaxPlayers>
These tags expand out to the minimum and maximum number of players that the current game supports, respectively.
<GDBGamePlayerRange separator="xx">
This tag expands out to an expression of the number of players that the current game supports, much like
<GDBGameMinPlayers> and <GDBGameMaxPlayers> do. This tag is different in that if the minimum
and maximum number of players is the same, that single number is used as the expansion. This allows for a
more natural expression of the number of players for games which need an exact number of players to play.
The optional attribute separator sets the text that should be displayed between the minimum
and maximum player counts. If it is not provided, the default is " - ", that is, a single dash surrounded
by spaces.
<GDBGameHasBGGInfo negate>
This conditional tag allows you to test to see if a
BoardGameGeek
GameID has been entered for this game or not. This is the BoardGameGeek equivilant of the GameDB GameID.
The
optional attribute
negate reverses the sense of the test, so that instead
of testing to see if the BGG ID is set, it instead checks to see if it is not set.
If there is (or is not, in the case of
negate) BGG GameID information for this game, the
contents of the container will be expanded out. Otherwise, it is skipped entirely.
<GDBGameBGGID>
This tag expands out to the
BoardGameGeek game id for
the current game, or empty text if that iformation has not been entered for this game. This number is the
BoardGameGeek equivilant of the GameDB GameID.
You can use <GDBGameHasBGGInfo> to determine if the BGG GameID has been entered before you use this tag to
obtain the BGG GameID.
<GDBGameBGGURL>
This tag expands out to the
BoardGameGeek game page for
the current game if the current game has BGG GameID information. If it does not, then this tag instead expands out
to empty text.
This URL allows you to jump directly to the BoardGameGeek page for the current game.
You can use <GDBGameHasBGGInfo> to determine if the BGG GameID has been entered before you use this tag to
obtain the URL.
<GDBGameExpandsGame negate>
This conditional tag allows you to test to see if this game is listed as an expansion for some other game or not.
The optional attribute negate reverses the sense of the test, so that instead
of testing to see if this game is an expansion for some game, it instead checks to see if this game is not an expansion.
If this game is (or is not, in the case of negate) an expansion for some other game, the contents of the
container will be expanded out. Otherwise, it is skipped entirely.
<GDBGameExpansionID>
This tag works identically to
<GDBGameID>, except that is expands out to the GameID for the
game that this game is an expansion for, instead of this game itself.
If the current game is not the expansion for some other game, this expands out to empty text. You can use the
<GDBGameExpandsGame> tag to check for this.
<GDBGameExpansionName maxLength="##">
This tag works identically to
<GDBGameName>, except that is expands out to the name for the
game that this game is an expansion for, instead of this game itself.
If the current game is not the expansion for some other game, this expands out to empty text. You can use the
<GDBGameExpandsGame> tag to check for this.
<GDBGameExpansionURL>
This tag works identically to
<GDBGameURL>, except that is expands out to the URL for the
game that this game is an expansion for, instead of this game itself.
If the current game is not the expansion for some other game, this expands out to empty text. You can use the
<GDBGameExpandsGame> tag to check for this.
<GDBGameHasExpansions negate>
This conditional tag allows you to test to see if the database lists any games which are expansions for this
game or not.
The optional attribute negate reverses the sense of the test, so that instead
of testing to see if this game has expansions, it instead checks to see if this game does not have
any exansions.
If this game has (or doesn't have, in the case of negate) any expansions, the contents of the
container will be expanded out. Otherwise, it is skipped entirely.
<GDBGameExpansionCount>
This tag expands out to the number of games that are expansions for this game, as represented in
the database. This number may be 0.
<GDBGameExpansionlist>
This looping tag iterates all of the
Games in the system which are listed as being
an expansion game for the game currently being processed. The contents of this container will be
expanded into the output file once for each matching game. It is possible for the container to never
be expanded, if the current game does not have any expansions. You can guard against this by checking
using the
<GDBGameHasExpansions tag.
Each time the contents of the container is expanded out, the following tags become available to the
template, allowing you to obtain information about the games that expand this game.
<GDBExpansionID>
<GDBExpansionName maxLength="##">
<GDBExpansionDescription excerpt="xx">
<GDBExpansionURL template="xx">
These tags are only available inside of a
<GDBGameExpansionlist> container tag, and
function identically to the
<GDBGameID>,
<GDBGameName>,
<GDBGameDescription> and
<GDBGameURL> tags, except that they refer to the games
that are listed as expansions for the game being processed instead of
the game itself.
<GDBGameHasImages negate>
This conditional tag allows you to test to see if the current game has any
images attached to it or not.
The optional attribute negate reverses the sense of the test,
so that instead of testing to see if the game has any images attached, it instead
checks to see if the game does not have any images attached.
If this game has (or doesn't have, in the case of negate) any expansions,
the contents of the container will be expanded out. Otherwise, it is skipped entirely.
<GDBGameImageCount>
This tag expands out to the number of images that are attached to this game. This number
may be 0.
<GDBGamePrimaryImageWidth size="xx">
<GDBGamePrimaryImageHeight size="xx">
<GDBGamePrimaryImageURL size="xx">
These tags can be used to determine the width, height and URL of the image marked
as the
primary image for this game. When the game has no primary
image, these tags expand out to empty text; that is, they are removed from the
template with nothing inserted in their place. You can check for this by using
the
<GDBGameHasImages> tag.
Each tag takes an
optional attribute
size, which allows you
to specify which of the different sizes of images you would like information for.
The possible values of
size are:
- full to use the full size image (default)
- small to use the smaller sized image
- thumb to use the thumbnail sized image
<GDBGameHasStock negate>
<GDBGameHasSold negate>
<GDBGameHasPrice negate>
<GDBGameHasSalePrice negate>
<GDBGameIsOnSale negate>
<GDBGameIsNewItem negate>
These conditional tags allow you to check to see if the values of the
extended game fields
are set for this game. As GameDB always stores values wether extended fields are turned on or not, these
check to see if the values indicated are 0 or not.
The
optional attribute
negate reverses the sense of the test,
so that instead of testing to see if the values are 0, it instead checks to see if the
values are not 0.
If the value of the field is 0 (or not 0, in the case of
negate), the
contents of the container will be expanded out. Otherwise, it is skipped entirely.
<GDBGameStock>
<GDBGameSold>
<GDBGamePrice>
<GDBGameSalePrice>
These tags expand out to the current values of the various
extended game fields
for the current game.
Game index template tags
Some contents go here.
Category, Publisher and Designer list template tags
Some contents go here.
Category, Publisher and Designer index template tags
Some contents go here.