Gallery Extended 2.1 Entries

The GX entries function takes a number of parameters and returns a list of images.

{exp:gallery_extended:entries}

Parameters

author_id=

author_id="4"

You can filter your list of images by the member id of the user who submitted them.

days=

days="10"

You can restrict the number of images returned to the last number of days.

disable=

disable="member_fields|date_fields"

If you don't need either member fields or date fields or both, you can improve template load time by disabling their subroutines using the 'disable' parameter.

dynamic=

dynamic="off"

The 'dynamic' parameter allows you to prevent the Entries function from being affected by what the URL contains.

gallery_name=

gallery_name="Your Gallery"

The 'gallery_name' parameter allows you to show a specific photo gallery. You can use either the short_name or the Full Name of the photo gallery.

hours=

hours="24"

You can restrict the number of images returned to the last number of hours.

limit=

limit="10"

You can restrict the number of images returned using the 'limit' parameter.

orderby=

orderby="entry_date"

The 'orderby' parameter allows you to specify the order your results. Options are 'author_id', 'filename', 'title', 'caption', 'custom_field_NUMBER', 'entry_date', 'edit_date', 'recent_comment_date', 'total_comments', 'views', 'gx_related_id'

offset=

offset="3"

The 'offset" parameter allows to you to skip/exclude the first specified amount of entries from showing.

template=

template="template_group/template_name"

When you provide the 'template' parameter, you tell GX what template to use to format messages returned by the module for successful and unsuccessful actions. You will most likely be using the 'template' parameter to enable AJAX functionality.

Available in the template that you refer to in the parameter are two conditionals and one variable. {if success}{/if} will evaluate to true if the submission action is successful. {if failure}{/if} will evaluate to true if the submission fails for some reason. And {message} will return the message from GX indicating the details of a successful or unsuccessful action.

related_id=

related_id="{entry_id}"

The 'related_id' parameter allows you to call images that have been associated with an entry in EE.

sort=

sort="asc"

The 'sort' parameter allows you to specify the results in ascending (asc) or descending (desc) order.

type=

type="weblog"

When users submitted images using your form, you may have provided a 'type' in order to track what type of entry the images were associated with. Call that same type here to fetch the uploaded images.

Variables

count

{count}

The {count} variable allows you to display the order number of the current entry.

date_fields

{date_fields}

Unless you disble the parsing of date fields in the 'disable' parameter, all member related date fields as well as the entry_date of the uploaded image will be available.

extension

{extension}

This variable will be replaced by the file extension of the image.

filename

{filename}

This variable will be replaced by the filename of the image.

gallery_entry_id

{gallery_entry_id}

Each gallery entry has an entry id, the gallery_entry_id represents that number.

height

{height}

This variable will be replaced by the height of the full sized image.

image

{image}

This variable will be replaced by a complete image tag for the full image.

image_url

{image_url}

This variable will be replaced by full url to the full sized image.

m_height

{m_height}

This variable will be replaced by the height of the medium sized version of an image.

m_width

{m_width}

This variable will be replaced by the width of the medium sized version of an image.

medium

{medium}

This variable will be replaced by a complete image tag for the medium size version of an image.

medium_url

{medium_url}

This variable will be replaced by full url to the medium sized image.

member_fields

{member_fields}

All custom member fields are available in this function.

t_height

{t_height}

This variable will be replaced by the height of the thumbnail sized version of an image.

t_width

{t_width}

This variable will be replaced by the width of the thumbnail sized version of an image.

thumb

{thumb}

This variable will be replaced by a complete image tag for the thumbnail size version of an image.

thumb_url

{thumb_url}

This variable will be replaced by full url to the thumbnail sized image.

total_count

{total_count}

The {total_count} variable allows you to display the total number of entries.

width

{width}

This variable will be replaced by the width of the full sized image.

Variable Pairs

You can run conditionals on any of the fields above.

Examples

Below is an example of how a very basic Gallery Extended entries form would look:

{exp:gallery_extended:entries gallery_name="Your Gallery" orderby="entry_date" sort="asc"}
 
<div>
<p><a href="/template_group/template/{entry_id}/"><img src="{thumb_url}" width="{t_width}" height="{t_height}" alt="{title}" /></p></a>
<h3>{title}</h3>
<p>{caption}</p>
</div>
 
{/exp:gallery_extended:entries}

Below is an example of how you can manipulate Gallery Extended to mimic the native EE Photo Gallery module using the {count} variable:

<table width="100%" border="0" cellspacing="0" cellpadding="10">
<tr>
 
{exp:gallery_extended:entries gallery_name="Your Gallery" orderby="entry_date" sort="asc"}
 
<td>
<p><a href="/template_group/template/{entry_id}/"><img src="{thumb_url}" width="{t_width}" height="{t_height}" alt="{title}" /></p></a>
<h3>{title}</h3>
<p>{caption}</p>
</td>
 
{if count == "5"}</tr><tr>{/if}
{if count == "10"}</tr><tr>{/if}
{if count == "15"}</tr><tr>{/if}
{if count == "20"}</tr><tr>{/if}
 
{/exp:gallery_extended:entries}
 
</tr>
</table>

Below is a basic example of how you can display related Gallery entries with Weblog Entries on a single entry page (in the event that you’ve already “related” photos to weblog entries):

{exp:weblog:entries}
 
<h1>{title}</h1>
<p>{body}</p>
 
{/exp:weblog:entries}
 
 
{exp:gallery_extended:entries gallery_name="Your Gallery" type="weblog" dynamic="on" related_id="{entry_id}" orderby="entry_date" sort="asc"}
 
<div>
<p><a href="/template_group/template/{entry_id}/"><img src="{thumb_url}" width="{t_width}" height="{t_height}" alt="{title}" /></p></a>
<h3>{title}</h3>
<p>{caption}</p>
</div>
 
{/exp:gallery_extended:entries}