There is a function to show a galleria in lightbox so far.
Could you provide a function for http://drupal.org/project/shadowbox , too?

I tried to adapt this by hand with no success. the link is not displayed.

in function galleria_theme() I added:

'galleria_shadowbox_link' => array(
      'arguments' => array('nid' => NULL),
    ),

and added this function:

function theme_galleria_shadowbox_link($nid, $width, $height, $text) {
  if (!is_numeric($nid) || !is_numeric($width) || !is_numeric($height)) {
    drupal_set_message(t('Invalid arguments passed to theme_galleria_shadowbox_link.'), 'error');
    return;
  }

  if (!module_exists('shadowbox')) {
    drupal_set_message(t('Please install the shadowbox module to enable this functionality'), 'error');
    return;
  }

  $attribs = array(
    'rel' => 'shadowbox',
  );
  return l($text, "galleria/$nid", array('attributes' => $attribs, 'html' => TRUE));
}

what did I miss?

CommentFileSizeAuthor
#3 galleriaShadowBoxSupport.patch.txt1.1 KBmaulwuff

Comments

maulwuff’s picture

sorry, these changes DO work. The link is shown now. Must have been a caching thing.
clicking the link creates the pure galleria, but shadowbox is not triggered, yet. I hope to get this working, too

maulwuff’s picture

Status: Active » Needs review

finally I got it working.

the function call should be:

it is important to add player=iframe to the rel attribute.

/**
 * Theme the link that opens a shadowbox with a galleria in it
 */
function theme_galleria_shadowbox_link($nid, $width, $height, $text) {
  if (!is_numeric($nid) || !is_numeric($width) || !is_numeric($height)) {
    drupal_set_message(t('Invalid arguments passed to theme_galleria_shadowbox_link.'), 'error');
    return;
  }

  if (!module_exists('shadowbox')) {
    drupal_set_message(t('Please install the shadowbox module to enable this functionality'), 'error');
    return;
  }

  $attribs = array(
    'rel' => 'shadowbox;player=iframe;width='.$width.';height='.$height.';',
    'title'=> $text,
  );
  return l($text, "galleria/$nid", array('attributes' => $attribs, 'html' => TRUE));
}

find a patch attached with all necessary changes

to create the link use the analogon to the lightbox one:

theme_galleria_shadowbox_link($nid, $width, $height, $text)

see an example for usage in #352081: Where to include theme function for lightbox #3

maulwuff’s picture

StatusFileSize
new1.1 KB

drupal dropped the patch.

the patch is based on 6.x-1.0-beta1

Mark Theunissen’s picture

Status: Needs review » Needs work

Hi maulwuff

Thanks for the patch. Sorry to do this to you, but I have dropped iFrame support because it was the wrong, slow, bad way to get the galleria into a lightbox... :(

As of Beta 2 the galleria is returned as HTML and embedded in the lightbox. This is now really stable! :)

Could you have a look at Beta 2 and re-roll your patch please? I don't think anything will change except the parameters you pass to shadowbox (i.e. the player=iframe bit).

That's if you're still interested in incorporating this functionality in by default.

maulwuff’s picture

hi, yes i'll have a look at it

maulwuff’s picture

does lightbox work for you? it puts the thumbs to the lightbox and prints the big image to the normal page. but not visible as long as the lightbox is active.

with shadowbox I get a ul-list of images.

Mark Theunissen’s picture

Anything further on this patch? Lightbox works well in my testing.

maulwuff’s picture

sorry, got no clue what may be wrong

Mark Theunissen’s picture

Status: Needs work » Closed (won't fix)