Retired Documentation: You are using the documentation for version 1.7.3 which was retired in 2013. Go here for the latest version documentation or check here for your available upgrades to the latest version.
Gallery Entry Tag Parameters
A variety of parameters can be added to control what is displayed by the gallery tag. Parameters are added to the opening partion of the tag. Here is a simple example of the gallery tag with four parameters.
{exp:gallery:entries gallery="vacation" orderby="date" columns="4" rows="2" }
content
{/exp:gallery:entries}
In the above example, 2 rows of entries are shown, with 4 images per column, all from the "vacation" gallery, ordered by "date".
The following parameters are available:
- category="2"
- columns="4" rows="2"
- dynamic="off"
- entry_id="147"
- entry_id_from="20"
- entry_id_to="40"
- gallery="vacations"
- limit="10"
- log_views="off"
- orderby="date"
- paginate="top"
- show_future_entries="yes"
- sort="asc"
- status="open"
category=
category="2"
Categories are specified by ID number (the ID number of each category is displayed in the Control Panel for the gallery). The reason we use the ID is because categories can be called anything (with spaces, quotes, etc.), and also renamed.
You may specify multiple categories by separating them with the pipe character:
category="2|45|4|9"
Or use "not" to exclude categories
category="not 4|5|7"
columns= rows=
columns="4" rows="2"
You may specify how many columns and rows the entry output will contain. This will also naturally limit the number of entries displayed. Using the above values, 8 entries would be shown. If these values aren't specified each will default to "3".
dynamic=
dynamic="off"
The gallery display engine sets some parameters dynamically, based on what is in the URL. There are times, however, where you do not want the parameters affected by what the URL contains. To override the dynamic nature of the weblog tag, use dynamic="off".
This is often useful if you want to list entries in a "sidebar" on your site and have them always be the same ones regardless of which page on your site you visit (main page, archives, comments, etc.). By setting dynamic="off" you will ensure that the list is not affected by anything passed in the URL.
entry_id=
entry_id="147"
You can hard code the gallery tag to show a specific gallery entry. You may also specify multiple entries by separating them with the pipe character:
entry_id="13|42|147"
Or use "not" to exclude entries
entry_id="not 7|26"
entry_id_from=
entry_id_from="20"
This parameter is used together with entry_id_to= to designate a range of entries to display. This parameter indicates the beginning of the range. With the example above, the tag would begin displaying entries starting with entry ID 20.
entry_id_to=
entry_id_to="40"
This parameter is used together with entry_id_from= to designate a range of entries to display. This parameter indicates the end of the range. With the example above, the tag would stop displaying entries at entry ID 40.
gallery=
gallery="vacations"
This parameter is required. The name (short name) of the gallery for which you wish to display the entries.
limit=
limit="12"
This parameter limits the number of entries on any given page. If you are using pagination then this will determine the number of entries shown per page.
Note that this parameter is usually unnecessary since the columns= rows= parameters will naturally limit the display.
log_views=
log_views="off"
This parameter allows you to switch off hit tracking for single gallery entries. If you do not specify this parameter, it will default to "on".
- log_views="on"
- log_views="off"
orderby=
orderby="date"
The "order" parameter sets the display order of the entries. Setting options for this parameter include:
- orderby="caption"
- orderby="date"
- orderby="edit_date"
- orderby="entry_id"
- orderby="most_comments"
- orderby="most_recent_comment"
- orderby="most_views"
- orderby="random"
- orderby="screen_name"
- orderby="title"
- orderby="username"
paginate=
paginate="top"
paginate="bottom"
paginate="both"
This parameter is for use with entry pagination and determines where the pagination code will appear for your gallery entries:
- top: The navigation text and links will appear above your list of entries.
- bottom: The navigation text and links will appear below your list of entries.
- both: The navigation text and links will appear both above and below your list of entries.
If no parameter is specified, the navigation block will default to the "bottom" behavior.
show_future_entries=
show_future_entries="yes"
You can determine whether you wish for entries dated in the "future" to be included. This option is useful when doing things like creating a list of events, some of which have not occurred yet.
sort=
sort="asc"
sort="desc"
The sort order can be ascending or descending. The order will default to "descending" if nothing is specified.
status=
status="open"
The gallery status to which you would like to restrict display. You may choose either "open" or "closed". If you do not specify this parameter, it will default to "open".
Variables
Further, inside of the tag you can use a number of variables to display different information such as entry title, date, body, etc.