Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extending I18N Gallery
#1
If you want to create a new gallery type type for I18N Gallery, you need to
  • create a new PHP file plugin_type.php in plugins/i18n_gallery, and in this file
  • register the type with i18n_gallery_register('type', 'Name for dropdown', 'description including licensing information', 'i18n_gallery_type_edit', 'i18n_gallery_type_header', 'i18n_gallery_type_content')
  • create a function i18n_gallery_type_edit to display the options in the administration
  • create a function i18n_gallery_type_header to output the CSS and JS includes in the HTML header
  • create a function i18n_gallery_type_content to output the gallery itself.

Ad i18n_gallery_type_edit:

All fields must be named type-xxx

Ad i18n_gallery_type_header:

Use helper functions from helper.php, e.g.
  • i18n_gallery_check to check for general gallery settings
  • i18n_gallery_needs_include to check if a file needs to be included or was already included for another gallery

Make sure to separate your CSS into general parts (for all galleries of this type) and specific parts (e.g. size settings for the current gallery.

Ad i18n_gallery_type_content:

If the gallery shows thumbnails you should check, if only one thumbnail should be displayed (function i18n_gallery_thumb) and hide all other thumbnails in this case.

You should also check, if a specific picture ($pic) should be displayed.

Preferably the gallery should also work with Javascript switched off (currently cycle works without Javascript and fancybox and prettyPhoto have a fallback).

Please look at the existing gallery types (plugin_xxx.php) for more information.

Edit: This information and more can also be found here.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#2
Thanks a lot ! very very helpful !
Reply
#3
mvlcek Wrote:Please look at the existing gallery types (plugin_xxx.php) for more information.

Martin, could you add this to your documentation? It is so difficult to find in the forum ;=)

Cheers, Connie
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#4
Connie Wrote:Martin, could you add this to your documentation? It is so difficult to find in the forum ;=)

Thanks, Connie - I was looking for this!
I knew I had written something like this, but neither the search term i18n_gallery_register nor gallery register would return anything :-(

I have already started to document it here, now I can include the information in this thread.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply




Users browsing this thread: 1 Guest(s)