Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extending I18N Gallery
Author Message
mvlcek Offline
Posting Freak

Posts: 1,762
Joined: Jan 2011
2011-12-18 20:22:25
Extending I18N Gallery
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.
(This post was last modified: 2012-04-02 19:15:50 by nime.)
Visit this user's website Find all posts by this user Quote this message in a reply
didou038 Offline
Member

Posts: 112
Joined: Dec 2011
2011-12-18 20:38:23
Extending I18N Gallery
Thanks a lot ! very very helpful !
Find all posts by this user Quote this message in a reply
Connie Online
Super Moderator

Posts: 2,719
Joined: Feb 2011
2012-03-29 02:05:46
Extending I18N Gallery
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

|--
Die deutsche GetSimple-Webseite: http://www.Get-Simple.de = the german Get-Simple-Website!
Das deutschsprachige GetSimple-(Unter-)Forum: http://get-simple.info/forums/forumdisplay.php?fid=18
Find all posts by this user Quote this message in a reply
mvlcek Offline
Posting Freak

Posts: 1,762
Joined: Jan 2011
2012-03-29 02:34:39
Extending I18N Gallery
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.
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)

Contact Us | GetSimple | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication
Generate Leads from Documents vCard Hosting