Hello, thanks for a marvellous module.

Is it possible to set Zoomify as the default node view for Image node type anyway?

I mean not just redirecting but all bells and whistles might be intact on page including comments. This may be very versatile instead of just another bare page with zoomify applet, which user "may" click if tab "is not" overlooked.

Even inline images can gain this functionality :)

We are using Image/Image Assist combination on Drupal 6.9 by the way. Any workaround will also be greatly appreciated.

Thanks in advance.

Comments

infojunkie’s picture

Assigned: Unassigned » infojunkie
Status: Active » Postponed

This is something that's been on my mind for a while, but it requires careful design to integrate smoothly with the tons of image modules that exist already. So don't hold your breath :-) In the meantime, as a workaround, here's what you can do:
* In your node lists, views, etc., make sure the node links point to the zoomify version (i.e. /node/%nid/zoomify)
* Modify theme_zoomify to include the "bells and whistles" that you need

Hope this helps!

chawl’s picture

I love themable functions :)

Thank you very much.

chawl’s picture

Anyway, it is impossible to rewrite all links dynamically to zoomify view properly and path_auto is another major problem as well.

I used another workaround for "Image" module and used the code below in "node-image.tpl.php"

    <?php 
    if(zoomify_load($node->nid)) {
      print $node->content['body']['#value'];
      print zoomify_display($node, 0);
    }
    else {
      print $content;
    }
    ?>

Can there be any problem with this API like method? I would be glad if someone can comment.

Tx in advance.

sgriffin’s picture

Thanks chawl, Works great. Then you can comment out lines 23-31 in zoomify.module to remove the tab, and run update.php

infojunkie’s picture

Category: feature » support
Status: Postponed » Closed (fixed)

Thanks chawl for documenting your workaround. I will post that on the module's project page.

jcdarwin’s picture

Status: Closed (fixed) » Needs work

Chawl's comment above about the workaround checking zoomify_load($node->nid) for a true value was working fine for me with the previous vesion of the zoomify module (version 6.x-1.1), but now that I've installed the latest version (6.x-1.2), print zoomify_display($node, 0) works fine, but only if I comment out if (zoomify_load($node->nid)).

Everything else works fine with this module -- image tiles are being created, and I can zoomify the image in question as long as I don't refer to if (zoomify_load($node->nid))

infojunkie’s picture

Version: 6.x-1.x-dev » 6.x-1.2

@jcdarwin, what happens when you call zoomify_load in the template? And how did you manage to determine if the node can be zoomified or not?

jcdarwin’s picture

Had a look and found that line 33 of zoomify_load ( if (!variable_get('zoomify_showtab', TRUE)) return FALSE;) is returning FALSE because zoomify_showtab is 0.

I've checked off "Show tab" in the Zoomify settings, as I need to show the zoomify image directly in the node template.
The relevant piece of my node-image-tpl.php looks like:

<div class="content clear-block">
    <?php if (zoomify_load($node->nid)): ?>
        <!-- Show zoomify version of image -->
        <?php print zoomify_display($node, 0); ?>
        <?php print $node->content['transcription_form']['#value']; ?>
        <?php print $node->content['community_tags']['#value']; ?>
    <?php else: ?>
        <!-- Show content as per normal -->
        <?php print $content ?>
    <?php endif; ?>
</div>

I'm probably implementing Zoomify in a non-standard way, as I'm displaying a zoomified image outside of the zoomify tab, so maybe this behaviour is to be expected?

infojunkie’s picture

Status: Needs work » Closed (fixed)

@jcdarwin, the way you're implementing zoomify is what this thread is all about! I've modified the FAQ entry on the module page to mention the "Show tab" setting.

chawl’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
Status: Closed (fixed) » Active

Hello kratib,

On the newest dev version, if "Show Tab" is disabled, zoomify applet is also disabled for default view. Therefore, my original workaround (tx for crediting my name) does not work anymore. Probably zoomify_load($node->nid) returns false.

Any ideas?

Tx in advance.

infojunkie’s picture

@chawl & everyone,

I am very sorry for the confusion I've caused you. Indeed, zoomify_load() could not work if 'zoomify_showtab' was OFF.

I fixed this by creating a new function zoomify_check($node) that you should call instead of zoomify_load($nid) in your template file. So the simplest form of the template would now look like:

if (zoomify_check($node)) {
  print $node->content['body']['#value'];
  print zoomify_display($node);
}
else {
  print $content;
}

Please try it (12 hours from now) and let me know if that works. If it does, I will create a new release of Zoomify and update the documentation on the module page.

Thanks for your patience!

chawl’s picture

Status: Active » Fixed

Yesss, I confirm that the new solution works perfectly.

Thank you for your (very) fast consideration :)

jcdarwin’s picture

Unfortunately now my theme overrides don't work.

I notice that previously (zoomify-6.x-1.2) you had:

function zoomify_display($node, $index = 0) {
  $images = _zoomify_images($node);
  return theme('zoomify', $node, $images, $index); 
}

but now (in zoomify-6.x-1.3) you have:

function zoomify_display($node) {
  return theme_zoomify_page($node);
}

I.E. you seem to be hard-coding the calls to those in zoomify.module, rather than let be overriden by theming. Previously (in zoomify-6.x-1.2), my phptemplate_zoomify function would allow me to override the behaviour in zoomify.module, as I wanted to use the yui-resize bar to allow the user to be able to resize the zoomify window to suit their screen (therefore I needed to put class="yui-resize" in the div surrounding the zoomfiy object).

I think I'm right in saying that you've now made the zoomify code (now in theme_zoomify_page and theme_zoomify) non-themeable, whereas previously it was themeable?

infojunkie’s picture

What an omission! Sorry about that, I restored proper theming in the latest dev.

Status: Fixed » Closed (fixed)

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

davidhk’s picture

I tried the approach in #11, but even when using the full node.tpl.php, I couldn't see some CCK fields that I'd added to the image node type. So instead I override the function from the image module that displays an image in the body of a node.

In image.module you'll find this:

/**
 * Theme a body
 */
function theme_image_body($node, $size) {
  return image_display($node, $size);
}

In my theme's template.php I added:

function YourThemeNameHere_image_body($node, $size) {
  if ( zoomify_check($node) ) {
    return zoomify_display($node) ;
  }
  else {
    return image_display($node, $size);
  }
}

Then any image node that has been zoomified now automatically shows the zoomify image viewer in the default node view. Plus the rest of the node (taxonomy, comments, CCK fields, etc) displays as normal.

infojunkie’s picture

Thanks for the info! I updated the relevant FAQ on the module's page.