Menu Content/Inhalt
Software articles, reviews, downloads.
Home


User Login






Lost Password?
No account yet? Register

Syndicate

Gallery2 Image Extractor Documentation
User Rating: / 3
PoorBest 
Written by Jon Schutz   
Thursday, 25 January 2007

Gallery2 Image Extractor Content Plugin

Extracts an image from a Gallery2 album for insertion directly into content. The image can be a specific image, or random, or recently viewed, or any of the other options provided by the Gallery2 Image Block API. Has similar functionality to the Gallery2 Image Block module, but as a content plugin.


Basic Example:

{mosg2image blocks=randomImage show=title|date maxSize=100 linkTarget=_new}

Options:

Note that options are CASE SENSITIVE!
  • blocks - Pipe(|) separate list chosen from: randomImage, recentImage, viewedImage, randomAlbum, recentAlbum, viewedAlbum, dailyImage, weeklyImage, monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum, specificItem; default is randomImage
  • show - Pipe(|) separated list chosen from: title, date, views, owner, heading, fullSize; the value can also be: none
  • itemId - Limit the item selection to the subtree of the gallery under the album with the given id; or the id of the item to display when used with specificItem block type
  • maxSize - Scale images to this maximum size. If maxSize exceeds the thumbnail dimensions, you must also specify show=fullSize
  • linkTarget - Add a link target (for example, to open links in a new browser window)

The above are all G2 Image Block options. The values are passed straight through to the GalleryEmbed::getImageBlock API, so any parameters added in the future should also work.

The following additional options are also supported:

  • quantity - Number of image blocks to generate (all with the same parameters)
  • skip_error - Under normal circumstances, any error generated by G2 will be displayed in the output. If this worries you, just add skip_error to the parameter list

More Examples

Show a specific image

First, visit your album and find the image that you want to show. Click on the image to get the single item view, and then have a look at the URL, which will contain g2_itemId=[number]. Let's say it's 87 in this case, and we want to show the image 420 pixels wide, with title and date captions, opening in a new window when clicked on:

{mosg2image blocks=specificItem itemId=87 show=fullSize|title|date maxSize=420 linkTarget=_new}
Show a selection of 3 random thumbnails
{mosg2image blocks=randomImage show=title maxSize=150 quantity=3}
Last Updated ( Tuesday, 13 February 2007 )