GalleryImage Plugin v1.1![]() Rob A's (Im)personal Blog.![]() |
(Im)Personal Menu(Im)Personal Sunlight
(Im)Personal Articles(Im)Personal Old StuffBlog Administration |
Rob A's (Im)personal Blog :: Gallery Image PluginI prefer to use Gallery (version 1.x) for managing my images. I've even set it up so that the gallery is embedded in my Serendipity template. One thing that was not nice, however, was using those images within blog entries. I did a quick search and discovered a WordPress plugin[?] called WP-Gallery by Geoff Hutchison. His code was a starting point for the Serendipity plugin I put together. Using the plugin is simple. Just install in the usual fashion, and configure the album URL and gallery URL. These must be full URLs (start with http://) and MUST NOT HAVE A TRAILING BACKSLASH, and will depend on where you installed Gallery. For example, my configuration has URL of Gallery set to http://www.silent9.com/gallery and URL of the Gallery album directory set to http://www.silent9.com/albums There is also a new option to specify the maximum window size when using the image popup target, which defaults to 640pixels The basic usage of the markup plugin is [GImage]album/image.ext[/GImage] with the .ext optional unless the image is something other than the default .jpg. An example of this basic usage: [GImage]summer05trip/IMG_0542[/GImage] shows up as $this->gimage_thumb('summer05trip/IMG_0542', trim('')). This is using the defaults, use the thumbnail, format it as a link, no alignment, and make the link point to the gallery page of that image. The behaviour can be extended with the full usage: [GImage size=sized|full|thumb; link=image|album|page; align=left|center|right|none; caption=text string;style=link|fancy|image]album/image.ext[/GImage] ParametersThese parameters can be in any order and must be separated by semicolons ";" size=sized|full|thumbwill use the gallery medium sized image in the body, full will use the full size image, thumb is the default thumbnail [GImagesize=sized]summer05trip/IMG_0542[/GImage] $this->gimage_thumb('summer05trip/IMG_0542', trim('size=sized')) There is no example for full here cause my full sized images are all pretty big. link=image|album|page will set the target link as the raw image, page (default) in the gallery for the image, or the whole album in the gallery. hover the mouse over to see the differences in the links. Note that I am currently running the Lightbox+ plugin at this site, which will cause any links to images to open using that method, rather than the default, bare image in a window. [GImage link=image]summer05trip/IMG_0542[/GImage] $this->gimage_thumb('summer05trip/IMG_0542', trim('link=image')) [GImage link=album]summer05trip/IMG_0542[/GImage] $this->gimage_thumb('summer05trip/IMG_0542', trim('link=album')) align=left|center|right|none will set the alignment. Note none and center are equivalent if using the fancy style. [GImage align=left]summer05trip/IMG_0542[/GImage] $this->gimage_thumb('summer05trip/IMG_0542', trim('align=left'))This should be left aligned [GImage align=right]summer05trip/IMG_0542[/GImage] $this->gimage_thumb('summer05trip/IMG_0542', trim('align=right'))This image should be right aligned [GImage align=center]summer05trip/IMG_0542[/GImage] $this->gimage_thumb('summer05trip/IMG_0542', trim('align=center'))
caption=text string will be the ALT tag for images and links, or caption text if fancy style is used. the default is "[PHOTO]" if none supplied. [GImage caption=Zoo Photo]summer05trip/IMG_0542[/GImage] $this->gimage_thumb('summer05trip/IMG_0542', trim('caption=Zoo Photo')) [GImage caption=Zoo Photo; style=fancy]summer05trip/IMG_0542[/GImage] $this->gimage_thumb('summer05trip/IMG_0542', trim('caption=Zoo Photo; style=fancy')) style=link|fancy|image defines the formating link (default) is the standard link, image displays it as an inline image, and fancy formats it using the Serendipity image manager css class of the current theme. An example of fancy is just above, so no need to repeat it here. [GImage style=image]summer05trip/IMG_0542[/GImage] $this->gimage_thumb('summer05trip/IMG_0542', trim('style=image')) New for version 1.1 is the ability to specify a link target: [GImage style=fancy;target=new]summer05trip/IMG_0542[/GImage] $this->gimage_thumb('summer05trip/IMG_0542', trim('style=fancy;target=new')) should open the image page in gallery in a new window. [GImage link=image;target=popup]summer05trip/IMG_0542[/GImage] $this->gimage_thumb('summer05trip/IMG_0542', trim('link=image;target=popup')) should open the image in a popup window. And these can be combined in any reasonable permutation... For example, If I want to use the resized image in a blog posting, fancy format and linking to the full size image in a popup window I would use: [GImage caption=New African Pavilion at the Calgary Zoo; style=fancy; size=sized; link=image; target=popup]summer05trip/IMG_0542[/GImage] $this->gimage_thumb('summer05trip/IMG_0542', trim('caption=New African Pavilion at the Calgary Zoo; style=fancy; size=sized; link=image; target=popup')) A zip of the plugin can be found in my download section: serendipity_event_galleryimage or the latest version can be obtained via Sparticus or CVSEnjoy! |
(Im)Personal TagsQuicksearch |
(Im)Personal Comments