GALLERY TimThumb Shortcode
docs/plugins/plugin.jacshortcode.gallery
/* Title: GALLERY TimThumb Shortcode pluginname: shortcodes_gallery description: provides a shortcode markup for a gallery in Phile version: 0.5 revisiondate: 23 OCT 2013 pluginauthor: jacmgr Chapter: plugins.2 */ [timthumb]: http://www.binarymoon.co.uk/projects/timthumb/ ## Images and Galleries This shortcode is used to display individual images or galleries. It uses [timthumb][timthumb] to create thumbnails and cache them. If you don't need thumbnails and just want to display images, [markdown already does that without using any plugin](#markdown). This plugin allows you to just put any image you want in the folder and specify a display size. The plugin handles the resizing and caching. [[#ENDSUMMARY]] The plugins assumes that the images are located in a folder named `files` under the current page names folder. So for example the page you are reading is `docs\plugins\plugin.jacshortcode.gallery`. Therefore the default location for files is `docs\plugins\files`. ## Using other locations You can add subfolders to organize your images using the `folder=somefolder` option. This will be a subfolder under the current pages `file` folder. You can specify a completely different subdirectorys folders. For instance while on this page in plugins folder, i can specify the images are to come from the `docs` folder instead using the `rootfolder=docs` option. ## Single Images ~~~~ [\\jactimthumb "puppy/flower1.jpg" width=300 float="left"] ~~~~ ~~~~ [\\jactimthumb "flowersbday/flower3.jpg" width=200 float="right" link=true rootfolder=posts] ~~~~ [jactimthumb "puppy/flower1.jpg" width=300 float="left"] [jactimthumb "flowersbday/flower3.jpg" width=200 float="right" link=true rootfolder=posts] <div class=clearfix></div> ## Gallery ~~~~ [\\jacgalleryfromfolder folder=puppy] ~~~~ [jacgalleryfromfolder folder=puppy] ## Notes and Details Timthumb is installed in a location separate from pico. The thumbs are cached in the timthumb folders. While you are testing, you need to clear that timthumb cache often. The actual full size images are stored in a folder named `files` under the same folder as the content file you are viewing. You can specify a subfolder in the shortcode as in the example above. `puppy` really means `files\puppy` ##Advanced ### Just get the thumb url ~~~~ [\\jactimthumburl "puppy/flower1.jpg" width=300 float="left"] ~~~~ displays > [jactimthumburl "puppy/flower1.jpg" width=300] ### Use Twig Filter Most of the shortcodes also can work as twig filters. Use it like this in your templates....... ~~~~ {{ jacshortcode('[\\jacgalleryfromfolder folder=dummyfolder width=200 rootfolder=posts]') }} { { jacshortcode('[\\jactimthumburl "puppy/flower1.jpg" width=300]') } } ~~~~ ## Markdown {#markdown} Markdown uses this for images. ~~~~  ~~~~ So if your images are already the size you want to be on your page, you don;t need a plugin, just use markdown ~~~~  ~~~~ 