Home Joomla CSS Gallery - Howto Plugin Code
2010-03-12
CSS Gallery Plugin Usage - Code
Written by Andreas Berger   
Monday, 20 July 2009 06:24
A survey of the possibilities to call, extend and modify galleries with the code in the content item.

The "CSS Gallery" Plugin is called from within the content item. The code used offers - beside of setting the folder with the images - additional possibilities to enhance and arrange the gallery.

 

A.) Gallery

The code consists of the call {*becssg}{/becssg*} (without the asterisks) and contains the name of the folder with your images. The path to this folder "/images/stories" is added by the plugin automatically and must not be inserted.

The complete call for example would look such as:

{*becssg}cssgallery{/becssg*} - without the asterisks

To use a folder within a folder, the path below "/images/stories/" is used, e. g. to use the folder /images/stories/folder/subfolder" the call would look such as:

{*becssg}folder/subfolder{/becssg*} - without the asterisks

In general that´s it and the gallery is ready to go.




B.) Parameter Overrides

Starting with version 1.2.0 the "CSS Gallery" offers the possibility to change every default setting from the backend whilst calling the plugin within the content item. With this feature it is possible to use different settings for every single gallery. One may create galleries of different width and height, change the number of thumbnails per row and more.

To achieve this, the call of the plugin gets extended by the needed parameters. They are separated from the folder name and from each other by vertical bars (|). The have the syntax PARAMETER=VALUE:

List of possible parameters:

width - maximum width of main image in pixel (integer) e.g.: 600

height - maximum height of main image in pixel (integer) e.g.: 450

iqual - quality of scaled main image in percent (integer) e.g.: 90

throw - number of thumbnails per row (integer) e.g.: 4

tqual - quality of thumbnails in percent (integer) e.g.: 70

prld - should we preload the images? possible values: 0 (no), 1 (yes)

align - align the gallery within the content item; possible values: 0 (right), 1 (center), 2 (left), 3 (float left), 4 (float right)

sort - images sort order; possible values: 0 (A-Z - DEFAULT), 1 (Z-A), 2 (old-new), 3 (new-old), 4 (random)

fixstart - leave the start-image visible on hover; possible values: 0 (no), 1 (yes)
(may be deactivated when showing images of different proportion in one gallery. not crossbrowser!)

caps - show captions; possible values: 0 (no), 1 (yes)

links - show links; possible values: 0 (no), 1 (yes)


Samples:

{*becssg}cssgallery|width=600|align=2{/becssg*} - without the asterisks
Regardless of the settings in the backend, this gallery is shown with a width of 600 pixel (width=600) and aligned left in the article (align=2)

{*becssg}cssgallery|caps=0|prld=0{/becssg*} - without the asterisks
No captions (caps=0), no preload (prld=0)

{*becssg}cssgallery|width=400|height=300|throw=5|iqual=95|tqual=70{/becssg*} - without the asterisks
Width 400 pixel (width=400), height 300 pixel (height=300), 5 thumbs per row (throw=5), quality of main image 95% (iqual=95), quality of thumbs 70% (tqual=70)

Notice:

The parameters listed here correspond with the parameters in the plugins configuration panel. Find a details description at: Howto Plugin .
The first parameter of the initial call always has to be the folder name (path). The sorting of the other parameters is arbitrarily.




C.) Captions

Captions and text have there own call. It´s:

{*becssg_c}gallery-number|imagefile|caption|text{/becssg_c*} - without the asterisks

Gallery-number:
The galleries within one content item are numbered by the plugin automatically starting with 0.
This setting is obligatory.

Imagefile:
The exact name of the file "myimage.jpg".
Left empty, the call is used as default for the whole gallery. This means, if there is no setting for an image, this one is used.

Caption:
The Caption. If left empty . . . no caption is shown.

Text:
The additional text below the caption. If left empty . . . no text is shown.

Samples:

{*becssg_c}0||myTitel|myText{/becssg_c*} - without the asterisks
This call sets "myTitel" and "myText" as the default values for the first gallery within the current content item by leaving the imagefile-value empty.
Notice: You don´t have to set a Default. If you don´t and there is no setting for an image, just nothing is shown.

{*becssg_c}1|pic01.png||myText{/becssg_c*} - without the asterisks
pic01.png of the second gallery in the content item has no caption but the text "myText"

{*becssg_c}0|pic02.png||{/becssg_c*} -without the asterisks
pic02.png in the first gallery shows no caption and no text although there is a default. The explicit setting overrides it.

{*becssg_c}0|pic05.jpg|myTitelA|myTextA{/becssg_c*} - without the asterisks
{*becssg_c}0|pic06.jpg|myTitelB|myTextB{/becssg_c*} - without the asterisks
{*becssg_c}0|pic07.jpg|myTitelC|myTextC{/becssg_c*} - without the asterisks
{*becssg_c}0|pic08.jpg|myTitelD|myTextD{/becssg_c*} - without the asterisks . . . and so on

Notice:
It is of no importance where within your content item and in which order your setting are.
The number of parameters has always to be 4. This means, a call always must contain 3 vertical bars, even if a setting is empty (e.g. the imagefile).
These vertical bars are protected characters within the calls and may not be used within your values.




D.) Links

If we want to link the images of our gallery, there is a third call to do so:

{*becssg_l}gallery-number|imagefile|URL|titel|target{/becssg_l*} - without the asterisks

Gallery-number:
The galleries within one content item are numbered by the plugin automatically starting with 0.
This setting is obligatory.

Imagefile:
The exact name of the file "myimage.jpg".
Left empty, the call is used as default for the whole gallery. This means, if there is no setting for an image, this one is used.

URL:
The URL you want to link the image with. e.g.: http://www.bretteleben.de

Titel:
The titel, shown when the mouse is over the image. e.g.: bretteleben.de

target:
The window, you want to open the linked URL. e.g.: _blank (new window), _self (same window)

Samples:

{*becssg_l}0||http://www.bretteleben.de|bretteleben.de|_blank{/becssg_l*} - without the asterisks
This call sets a default link for the first gallery within the current content item by leaving the value for the imagefile empty. The link opens in a new window.

{*becssg_l}1|pic01.png|http://www.disney.com|Disney|_self{/becssg_l*} - without the asterisks
pic01.png in the second gallery within the content item is linked to www.disney.com. The link opens in the current window.

{*becssg_l}0|pic02.png|||{/becssg_l*} -without the asterisks
We don´t want pic02.png in the first gallery within the content item to be linked. A special case, because as soon as we have links within a gallery, every image gets linked. Setting this empty call the image is linked to the current page, without any further setting.

{*becssg_l}0|pica.jpg|http://www.my.domain.com/myGreatProduct1|greatProduct1|_self{/becssg_l*} - without the asterisks
{*becssg_l}0|picb.jpg|http://www.my.domain.com/myGreatProduct2|greatProduct2|_self{/becssg_l*} - without the asterisks
{*becssg_l}0|picc.jpg|http://www.my.domain.com/myGreatProduct3|greatProduct3|_self{/becssg_l*} - without the asterisks
{*becssg_l}0|picd.jpg|http://www.my.domain.com/myGreatProduct4|greatProduct4|_self{/becssg_l*} - without the asterisks ... and so on

Notice:
It is of no importance where within your content item and in which order your setting are.
The number of parameters has always to be 5. This means, a call always must contain 4 vertical bars, even if a setting is empty (e.g. the imagefile).
These vertical bars are protected characters within the calls and may not be used within your values.


That's it, have fun with the plugin!


If you have questions or suggestions, please use the comment-function.

If you use this extensions, please post a rating and a review at extensions.joomla.org. Furthermore I appreciate everyone, supporting me with a link back to www.bretteleben.de on his/her website. The extension itself does not produce any hidden links, eastereggs or whatever.

Last Updated on Saturday, 27 February 2010 16:25
 
Comments (76)
@David Steele
76 Wednesday, 10 March 2010 22:38
A. Berger
Hi David!

"To access the private area of this site, please log in." ... so there is not a lot I can tell you about the page

Best regards
Andreas
A great plug-in
75 Wednesday, 10 March 2010 15:35
David Steel
I like this. It is clean, simple and works really well with the minimum of fuss and set up. So far, I have only a few minor defects that I need some help with:

1) I use captions but find that the descenders on characters like 'y' and 'g' are clipped when viewed in IE7 and IE8 (but not Firefox) - see my site at http://www.eaf.org.uk/index.php/test/championship-gallery.html and click on one of the tabs at the top to show a gallery.

2) The main image disappears if I mouse over it - can I stop this?

3) The first image caption text appears to be black while rollovers on the thumbnails show captions in grey. Is this a configuration setting somewhere?

Also, as an enhancement for the future, it would be nice if a chosen image stayed on screen if the thumbnail is clicked and the mouse moved away from the thumbnail.

Thanks

David
@Michael
74 Sunday, 07 March 2010 21:23
A. Berger
Hi Michael!

Not really - all I can do is using HTML and HTML attributes the way they are meant to be used. This does not prevent some browsers (by default or by user setting) from handling these attributes a way they are not meant because the developer of the program thinks this is the right way or because this is the way your visitor is used to surf the web. You will never have full control over the user experience on your site - my best tip: live with it. ;)

Best regards
Andreas
Links opening tabs
73 Sunday, 07 March 2010 19:07
Michael
Brilliant plug-in - thanks!

I have set it up with internal links in the thumbnails (using _self). When I use these links, Firefox opens a new tab.

Is there any way of forcing the new page to appear in the same tab, please?
@Cinesinho
72 Saturday, 06 March 2010 19:47
A. Berger
Hi Cinesinho!

No, that's not possible with this gallery because the main image you see is the background image of the link, attached to the thumb you are hovering with your mouse. If you need this functionality, you might want to have a look at the "Very Simple Image Gallery" (menu at the left), it changes the images onClick.

Best regards
Andreas
Fix Picture
71 Friday, 05 March 2010 09:20
Cinesinho
Hi, I Have a problem with CSS Gallery, because when I move the mouse over a thumb picture, the big picture change, but after the click, when I move the mouse out of the thumb, the big picture charge again.
Can I fix the showed picture with a click?
Z Index
70 Friday, 26 February 2010 06:29
Steve Kennedy-Williams
Not really needing higher z index. Just read another's issues and had the idea.

I'm getting back into joomla after a few years, and was exploring what extensions are available. Nice work.

Steve
@Steve Kennedy-Williams
69 Thursday, 25 February 2010 20:26
A. Berger
Hi Steve!

Using zIndex values about 100 will solve the problem for one user (you) and cause problems for hundreds of useres because it breaks extensions like expandable menus, that depend on the zIndex to overlap the content of the page.

Making the zIndex available via the configuration panel is an option and I will think about it. Meanwhile you might want to consider using the Very Simple Image Gallery (menu at the left), it works without any fixed zIndex-setting and is controlable via the plugins stylesheet (/plugins/content/plugin_vsig/vsig.css).

Best regards
Andreas
z-index hack
68 Thursday, 25 February 2010 09:36
Steve Kennedy-Williams
Couldn't you offset the gallery's starting z-index?

If you for example start at 100, then you have 99 layers available below it. Should be enough.
How about a plugin parameter to set starting z-index?
@Dylan L.W. van der Braak
67 Tuesday, 23 February 2010 21:20
A. Berger
Hi Dylan!

I'm sorry but that's not possible because it is the usage of the zIndex that allows to stretch the link holding the main image as background image over the thumbnails whilst still keeping them clickable.

Best regards
Andreas