NooseLadder Posted August 1, 2012 Share Posted August 1, 2012 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. Link to comment Share on other sites More sharing options...
Soma Posted August 1, 2012 Share Posted August 1, 2012 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') 1 Link to comment Share on other sites More sharing options...
Marty Walker Posted August 1, 2012 Share Posted August 1, 2012 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 :>) Link to comment Share on other sites More sharing options...
NooseLadder Posted August 1, 2012 Author Share Posted August 1, 2012 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. Link to comment Share on other sites More sharing options...
Marty Walker Posted August 1, 2012 Share Posted August 1, 2012 Is it this one? http://illo.clientsite.net.au If so then each image is a page under 'portfolio'. 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 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now