Oi,

How do I move the gallery-description above the gallery (default it's placed underneath the gallery/thumbnails). I've been trying to find the right .tpl file, but cant see anything about the description.

Thanks.

Comments

Rik’s picture

Hi cholden,
I only managed to fix this in the node_gallery.module file which is a bad location even if you would only lost this setting when updating the module. The different node content fields are displayed in order by weight. These values are fixed for this module file. It also can not be fixed with css because the description field does not have a unique identifier.
I'd would expect this to be set in the content type maintainance section under "Display fields" but it is not, perhaps a developer can say something about this?

Anyway to get around this you can edit node_gallery.module and look for the line (if you're using the latest version)

      $node->content['gallery'] = array('#value' => theme('gallery_images_list', $node, $config), '#weight' => -3);

change the weight to something like 20 and the description will appear on top of the images. Remember this when updating the module because this will get lost.

cholden’s picture

Status: Active » Fixed

Hi Rik,

Thanks for your reply.

I found the line and changes the current weight of -3 to 20 but there are no changes.

I tried changing the line here instead - from -3 to 20, which worked.
$node->content['gallery'] = array('#value' => theme('gallery_teaser', $node, $config), '#weight' => -3);

Thanks for giving me a hint :)

Problem solved!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

AlexanderPop’s picture

mattyoung’s picture

instead of hacking node_gallery itself, I use the following code to modify the weight value:


function customize_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'view':
      if (in_array($node->type, (array)node_gallery_get_types('gallery'))) {
        $node->content['#pre_render'][] = '_customize_change_node_gallery_gallery_description_weight';
      }
      break;
  }
}


function _customize_change_node_gallery_gallery_description_weight($element) {
  if (isset($element['gallery'])) {
    $element['gallery']['#weight'] = 10;
  }
  return $element;
}

You can change the gallery weight value to anything you want relative to other field.

justintime’s picture

Now *that* is cool. I didn't know about #pre_render. Thanks for the tip!