There is no documentation how to render the gallery items in a template.

After a lot of search across the module files and it's functions, this code function for me
<?php print gallery_assist_display($node, 'page', '') ?>

This code snnipet assume that is called in a node tha have the gallery_assist functionality.

Anything else for an advanced use in templates?

Comments

jcmc’s picture

Hi Xart,

Please see in the folder templates.

Are not there templates you can use?

You can use your snippet to, only I recomende the following steps

  // in case you not have the node object.
  $node = node_load($NID);
  // in case you have the node object.
  if (variable_get('gallery_assist_'. $node->type, 0) == 1) {
    $output = '';
    // check if items.
    // Variant I.
    if (count($node->gallitems) > 0) { 
      $output = gallery_assist_display($node, 'page', '');
    }
    // Variant II.
    $output = count($node->gallitems) > 0 ? gallery_assist_display($node, 'page', '') : '';
    
    // print or return the data.
    return $output;
  }

Regards
Juan Carlos

PS
Un saludo ;-)

Xart’s picture

What templates you refer?

In path gallery_assist/templates/ I only find these files

gallery-assist-display.css
gallery-assist-display.tpl.php
gallery-assist-item.tpl.php
gallery-assist-pager.css
gallery-assist-pager.tpl.php
README.txt

and I can't find this nice snnipet inside those...

It is documented?

jcmc’s picture

Please Xart,

explain better what is your goal, I have not undestood what you want or need.
The templates in the package from Gallery Assist are only a gest. If you want to use one you should copy the template to your theme folder. example garland, newswire etc. After clear the cache is the template active and you can change the code as you want or need.

Regards
Juan Carlos

Nicolas Ramirez’s picture

I copy the files edited it but nothing happends :'(

ctrnz’s picture

I can confirm - copying theme files

gallery-assist-display.css
gallery-assist-display.tpl.php
gallery-assist-item.tpl.php
gallery-assist-pager.css
gallery-assist-pager.tpl.php

does nothing and does not help to customize theme.
I use 'adaptivetheme' as core theme.

UPDATE: dismissed - i did something wrong before cause after some copy/paste and cache flushing got response from *tpl.php

mist’s picture

I can't get it to work...
I've copied all tpl.php files into my theme folder and only tmp.php which respond is pager.tpl.php....
I am using Adaptive Theme subtheme.

UPDATE:
gallery-assist-item.tpl is used for viewing single photo, it is not used to render items in list.

eL’s picture

Version: 6.x-1.9 » 6.x-1.18

in #1 is a little bug. It is not working out of the box, we don't have $NID variable. We need to get it from $node->nid