just photo

Gallerix: photogallery for Drupal - my notes

Julia 21/06/2009
та самая галерея Gallerix, которую пришлось настраивать

Where are a lot of modules for creating photo galleries with Drupal,
including third-party integration modules - like Gallery2.

Gallerix - that is rather small gallery for photo albums.

However I don't like this module very much,
fortunately, maintainers are going to rewrite it soon.

In my opinion, more flexible way to create photo gallery is just using CCK fields with views:

filefield + imagefield + imagecache + views + lightbox2 (или thickbox)

But recently I needed to customize Gallerix.

Additing additional preset for thumbnails

That is possible to add new sizes for you gallery thumbnails on the Gallerix general settings page (at /admin/gallerix/general)

But it dosn't work. To fix it we have to modify two line in moules/gallerix/managment.inc file:
line 201:

<pre>
$entry['name'] = array(
      '#type' => 'textfield',
      '#size' => 20,
      '#default_value' => $name, // julia changed
      //'#disabled' => $name == 'thumbnail' || $name == 'frame',
);
</pre>

How to add lightbox2

On the main page of Gallerix album there are several little thumbnails and a big photo,
that is ajax reloaded, but the size of this photo is restricted by setting.

And what if you want to see bigger photo and using thickbox, or any other plugin like that.

Let's add these possibility to our gallery.

Firstly, upload and enable LightBox2 module.

Secondly, add javascript file to your theme.
Add this line to your .info file:

scripts[] = 'js/my.js'

Create js folder in your theme with my.js file:

$(document).ready(function(){
   $('.gallerix-thumbnail-link').click(function(){
href = $(this).find('img').attr('src');
newhref = href.replace(/thumbnail/, 'original');
$('#gallerix-display a').attr({href: newhref});
  });
});

That is all!
Now you can click on the big photo in a Galleix album and you'll see a big Lightbox preview.

тэги:

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options