media:gallery()
From SkyPHP
Display an image gallery.
Contents |
Description
media::gallery ( $settings )
Parameters
$settings array of gallery settings
- vfolder - vfolder_id of vfolder to use images from, default = null (required parameter)
- grid_x - number of pictures to use for the gallery grid's width, default = 4
- grid_y - number of pictures to use for the gallery grid's height, default = 3
- id - html/css id to be prepended to all gallery related html ids, allows for multiple galleries to exist on a single page, default = 'gallery'.rand(0,10000)
- class - class to be applied to main gallery container, default = 'gallery'
- file - path to gallery generating file, default = 'pages/media/gallery/gallery.php'
- duration - unimplimented feature, default = 4000
- transition - jquery.cycles transition to use, default = 'fade'
- grid_margin - amount of space to place between cells of gallery grid, default = 0
- edge_padding - amount of space to place between edge of gallery and children, default = 0
- height_pane - height of the main image pane, default = 300
- width_pane - width of the main image pane, default = 475
- height_grid - total height of the gallery grid in pixels, default = (56+$grid_margin)*$grid_y
- width_grid - total width of the gallery grid in pixels, default = $width_pane
- height - total height of gallery, usually not needed, if used incorrectly may cause unexpected behaviour, default = $height_pane+$height_grid+((2*$edge_padding)+$grid_margin);
- width - total width of gallery, usually not needed, if used incorrectly may cause unexpected behaviour, default = ($width_grid>$width_pane?$width_grid:$width_pane)+(2*$edge_padding)
- height_enlarged - height of enlarged image, default = 800
- width_enlarged - width of enlarged image, default = 800
- speed - jquery.easing speed to use, default = 'null' (string)
- easing - jquery.easing easing to use, default = 'null' (string)
- css - array of css values to use (ie: array('#main_pane'=>'background-color: red;') ), default = null
NOTE: The number of images retrieved from vfolder is equal to $grid_x*$grid_y. Therefore, default number of images used in gallery is 3*4=12. If there are less than this amount of images in vfolder, then the grid will only be filled partially, may cause gallery to appear ugly.
NOTE: If height is provided and height is less than what would appropriately be calculated from other provided height values, the gallery grid will obscure a section of the main image pane that is equal to the difference between provided height and calculated height. Can be used to good effect but more often is the result of providing a height unnecessarily. Instead, provide height_pane and height_grid.
Examples
Gallery with 9 thumbnail images
$parameters = array(
'vfolder'=> 12345,
'width_pane'=>450,
'height_pane'=>400,
'grid_x'=>3,
'grid_y'=>3
);
media::gallery($parameters);
//will create a gallery of 9 images arranged 3x3 underneath a 450x400 main image pane
