Documentation » View Functions » Gallery

This a complete listing of official View Functions that can be used in your Gallery templates. Note that a parameter wrapped in square brackets ([]) is optional.

bam
bam( "gallery", [settings] )
Places Gallery content on the page, customized with the settings variable. Separate each setting with a comma.
settings
  • template template name
  • category comma separated list of categories
  • order_by
    • date default
    • title
    • simple_title
    • id
    • user_id
  • order_how
    • ASC Natural order (for example, alphabetical A-Z, numerical 1-10)
    • DESC Default. Reverse order (for example, alphabetical Z-A, numerical 100-1)
  • limit maximum number of sets to show
  • mode force a View Mode
    • list default
    • preview
    • fullview
  • force_display Use this to force displaying of content even if the current View Mode is different.
    • true
    • false default
  • library URL location to the View Library, if you have moved it from its default location. Default is [your secretary installation]/library
  • clean_urls Any links outputted will be in clean format
    • true
    • false default
  • urls_module Text to identify "module" in the URL. For example, www.mypage.com/?module=gallery can be changed to www.mypage.com/?m=gallery
  • urls_mode Text to identify "mode" in the URL.
  • urls_gallery Text to identify "gallery" in the URL.
  • urls_list Text to use for the "list" view. For example, www.mypage.com/?module=gallery&mode=list can be changed to www.mypage.com/?module=gallery&mode=listing
  • urls_preview Text to use for the "preview" view.
  • urls_fullview Text to use for the "fullview" view.
  • urls_id The "id" variable in the URL. For example, www.mypage.com/?module=gallery&mode=fullview&id=my-masterpiece or www.mypage.com/?module=gallery&mode=fullview&id=23.
    • simple_title default
    • id
bam( "gallery", "template= Sommerfugle, category= Dansk Design, Fun, library= http://www.staer.ca/library, urls_module= type, urls_gallery= folio, urls_fullview= view, order_by= title, order_how= ASC" );
ID
set_id()
Prints out (automatically displays) the database ID number of the current set. Useful for creating numbered or anchored links or anything that needs a unique identifier.
get_set_id();
Returns (does not show anything, instead stores the value in computer memory) the database ID number. Useful for use in other functions where a specific set ID needs to be specified.
Selected Set
selected_set()
Prints out the selected set's ID number. The selected set is the one currently being viewed by the user, for example, after he/she clicks on a link to view the full size image.
get_selected_set()
Returns the selected set's ID number.
Title
set_title()
Prints out the set's title.
Simple Title
set_simpletitle()
Prints out the set's simple title, which is the title without spaces, underscores or any non-alphabetical, non-numerical characters. This is also the name of the folder where the set's images are held.
make_simpletitle( text )
Will generate a simple title out of any text. This function removes any whitespace and non-alphanumeric characters. Spaces are converted to dashes.
Author/User
set_author( [info] )
Prints out the requested piece of information about the author/user who created the set.
info
  • id
  • username default
  • display_name
  • email
  • level_id user level id #
  • level user level name
// arne
<?php set_author( "username" ); ?>

// arne
<?php set_author(); ?>

// Arne Jacobsen
<?php set_author( "display_name" ); ?>

// arne@moebler.dk
<?php set_author( "email" ); ?>

// Master
<?php set_author( "level" ); ?>
Date
set_date( [format] )
Prints out the date the set was created.
format
  • d - Day of the month, 2 digits with leading zeros
  • D - A textual representation of a day, three letters
  • j - Day of the month without leading zeros
  • l - A full textual representation of the day of the week
  • S - English ordinal suffix for the day of the month, 2 characters (st, nd, th). Works well with 'j'.
  • F - A full textual representation of a month, such as January or March
  • m - Numeric representation of a month, with leading zeros
  • M - A short textual representation of a month, three letters
  • Y - A full numeric representation of a year, 4 digits
  • y - A two digit representation of a year
  • Take a look at www.php.net for more
// 23. Mar 1987
<?php set_date(); ?>

// March 23 1987
<?php set_date( "F d Y"); ?>
Description
set_description()
Prints out the set's description.
Related Link Title Related Link URL Type
set_type()
Prints out the type.
Cover Image
set_cover_image( [info], [set_id] )
Prints out the requested information about the cover image.
info
  • title
  • caption
  • file - will print out an HTML <img> tag.
  • thumbnail - will print out an HTML <img> tag.
set_id Use this to specify which set's cover image you want to display. If omitted, the currently selected set will be used. Also omit if you want to use the function in a template.
List Thumbnails
set_list_thumbnails( [list_wrapper], [thumb_wrapper], [id] )
Lists all the thumbnails in the given set. Using the "wrappers" you can wrap your thumbnails in any HTML code to create totally custom layouts. Style with your own CSS.
list_wrapper HTML code to wrap the list in. For example, a <ul> tag. thumb_wrapper HTML code to wrap the each thumbnail in. For example, a <li> tag. id Use this to specify which set's cover image you want to display. If omitted, the currently selected set will be used.
<?php set_list_thumbnails( '<ul></ul>', '<li></li>' ); ?>
List Images
set_list_images( [list_wrapper], [thumb_wrapper], [id] )
Exactly the same as List Thumbnails but displays the full-size images instead.
Set Image
set_image( number, [set_id], [number_is_id], [return] )
Displays the image in a set specified by number. If set_id is omitted then the currently selected set will be used.
number The number of the image in the set you would like to display. Note that the image displayed may not always be the same, if you change the order of the images. set_id Set ID number. Will access that set's images. number_is_id true or false Use this if you know the specific database ID number of the image. Set to true if number is the database ID. return true or false Set to true to have the function return an array with all image data - pair with Set Image Info to retrieve specific information.
Set Image Information
set_image_info( info, number, [set_id], [image] )
Displays the requested requested piece of information about the specified image.
info
  • id
  • title
  • caption
  • image displays only the filename
  • thumbnail displays only the filename
  • cover returns either 1 (is the set cover) or 0 (is NOT the set cover)
number The number of the image in the set you would like to display. Note that the image displayed may not always be the same, if you change the order of the images. set_id Set ID number. Will access that set's images. image This function can be used to get information about an image, by sending this parameter the result of Set Image (if return is set to true).
View Modes
gallery_is_mode( mode )
Returns true or false.
mode
  • list
  • preview
  • fullview
gallery_mode_is_list()
gallery_mode_is_preview()
gallery_mode_is_fullview()
Returns true or false.
gallery_mode()
Returns the current view mode (list, preview or fullview).
Title Link (View Mode) View Mode Link If Set Is Last
if_this_set_is_last()
Returns true or false. Lets you know if the current set is the last one listed. Useful for adding stylistic markup or showing/hiding certain content depending on the "position" of a set.
If Set Is NOT Last
if_this_set_is_not_last()
Same as If Set Is Last but returns true if the set is NOT the last one listed.
Category Dropdown Menu Get Categories Varal ImageSwitcher jQuery Cycle jQuery Lightbox