Custom image size for search results

Is it possible to output custom image size, like thumbnails, for search results? And how could I make link that simulates search query, so instead writing "something" I would have click on "something"?

Comments

  • You would have to modify the search.php file. I would not recommend you doing that just yet, the search function is still evolving. Wait until after the 1.1 release November 1.
  • yes, I know, I'm with it last days :-) and constantly updating local files, kinda learning php, for now everything that I tried works fine, cold you explain please what should I do?
    I need just this link/search/thumbnail thing so I can go online. thanx in advance
  • there is a template functin `printCustomSizedImage` that you would use in place of `$image->getThumb()`. You would have to have:
    `global $_zp_current_image;

    $_zp_current_image = $image;

    printCustomSizedImage($alt, $size, $width, $height, $cropw, $croph, $cropx, $cropy, $class, $id);`
    to print the image.
  • ok thanx I'll try
  • could anyone tell me how to include the customsizing imagefunction properly.
    that doesn't work..

    <? $w=156;
    while (next_image()):
    global $_zp_current_image;
    $_zp_current_image = $image;
    ?>
    <div class="image">
    <div class="imagethumb">" title="<? echo getImageTitle();?>"><? printCustomSizedImage(NULL, NULL, $w, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true);?></div>
    </div>
    <? endwhile; ?>
  • This is a snippet from stopdesign:

    `<?php <br />
    $ls = isLandscape();

    printCustomSizedImage(getImageTitle(), null, $ls?480:null, $ls?null:480);

    ?>`

    Perhaps yours did not work because the alt parameter was NULL.
Sign In or Register to comment.