Jump to content


Photo

Image Thumbnail Module - Images not displaying


  • Please log in to reply
4 replies to this topic

#1 NooseLadder

NooseLadder

    Full Member

  • Members
  • PipPipPip
  • 97 posts
  • 26

Posted 01 August 2012 - 06:42 AM

Hi,

I've installed PW. Installed the image thumbnail module. Installed template and created a page.

Here is the page: http://www.digsuk.co...sswire/gallery/

I have uploaded 1 image to the page but it is not displaying, only the image file name is showing gallery_1.jpg on the page.

I have put this in the template file: <?php echo $page->image_uploader; ?>

image_uploader is the name of the field I created with type CropImage.

I suspect I've missed something in the template code. Please help.

#2 Soma

Soma

    Hero Member

  • Moderators
  • 3,421 posts
  • 1944

  • LocationSH, Switzerland

Posted 01 August 2012 - 06:48 AM

To get url of an image:

echo $page->image_uploader->url;

And from the thumbnail doc:

echo $page->image_uploader->eq(0)->getThumb('thumbnail')

If single image field

echo $page->image_uploader->getThumb('thumbnail')

@somartist | modules created | support me, flattr my work flattr.com


#3 Marty Walker

Marty Walker

    Sr. Member

  • Members
  • PipPipPipPip
  • 347 posts
  • 165

  • LocationKatoomba, AU

Posted 01 August 2012 - 06:49 AM

Hi,

If it's a CropImage you might need something like:

<img src='{$page->image_uploader->getThumb('thumbnail_name')}'/>

Regards
Marty

edit: Soma beat me to it :>)

#4 NooseLadder

NooseLadder

    Full Member

  • Members
  • PipPipPip
  • 97 posts
  • 26

Posted 01 August 2012 - 07:11 AM

I want to achieve a similar layout to the portfolio page in Marty's video.

I want the website owner to be able to upload images that are automatically added to the thumbnails and the main image display, but without the need to add lines of code to the template page.

This is what I am missing here.

#5 Marty Walker

Marty Walker

    Sr. Member

  • Members
  • PipPipPipPip
  • 347 posts
  • 165

  • LocationKatoomba, AU

Posted 01 August 2012 - 08:06 AM

Is it this one? http://illo.clientsite.net.au

If so then each image is a page under 'portfolio'.

Posted Image

The part that drives the thumbnails and the main image looks like this:

<ul class="thumbs">
  <?
  foreach($pages->get("/portfolio/")->find("template=work-item, sort=sort") as $p)
  {
	if ($page->parents->has($p) || $p === $page) {
		$class = ' class="current"';
	} else {
		$class = '';
	}
	  echo "<li$class><a href='{$p->url}'><img src='{$p->image->eq(0)->getThumb('thumbnail')}' title='{$p->title}' alt='{$p->title}' width='61' height='61' /></a></li>";
  }
  ?>
</ul>
<img src='<?="{$page->image->eq(0)->size(0,373)->url}"; ?>' alt="title" />

Regards
Marty




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users