page list thumbnail

Permalink
anyone know if this can be done. its not realy a block

I need a pagelist thumbnail template done. i am using thumbnail template add on.
in the page list view with all the thumbnails of my pages - when the user clicks on a thumnbailimage - it takes him/her to a popup of a larger image.
When the user click on the Title it takes him to the desired page.

so i guess the a href for image goes to a popup
a href for h2 title goes to the page

any thoughts ? does this sound possible ?

J

oaknshield
 
daevision replied on at Permalink Reply 4 Attachments
PAGE LIST THUMBNAILS SOLVED!

Ok I don't know if this is exactly what you are looking for but it worked for me. I was working on a page list with thumbnails today and it took me a while to figure it out. I was adding a page list of blog_entry and they were not showing the thumbnails.

So what I did is I added an Image attribute to the page type and named the handler "thumbnail".(see 1st image) Then I added that attribute to the composer of that page type.(see 2nd image )

Then I had to modify the page list block in the concrete folder.\\concrete\blocks\page_list . Open view.php and you will see some code there that actually explains to you how to put thumbnails in the page lists. Why this isn't package with the default setup , is beyond me. Here is the instructions I found in view.php
* HOW TO USE IMAGE ATTRIBUTES:
       * 1) Uncomment the "$ih = Loader::helper('image');" line up top.
       * 2) Put in some code here like the following 2 lines:
       *      $img = $page->getAttribute('example_image_attribute_handle');
       *      $thumb = $ih->getThumbnail($img, 64, 9999, false);
       *    (Replace "64" with max width, "9999" with max height. The "9999" effectively means "no maximum size" for that particular dimension.)
       *    (Change the last argument from false to true if you want thumbnails cropped.)
       * 3) Output the image tag below like this:
       *      <img src="<?php  echo $thumb->src ?>" width="<?php  echo $thumb->width ?>" height="<?php  echo $thumb->height ?>" alt="" />
       *
       * ~OR~ IF YOU DO NOT WANT IMAGES TO BE RESIZED:
       * 1) Put in some code here like the following 2 lines:
       *        $img_src = $img->getRelativePath();
       *        list($img_width, $img_height) = getimagesize($img->getPath());
       * 2) Output the image tag below like this:


So follow those steps and now when you write in composer , choose your thumbnail and that's it , now you have page lists with thumbnails. You can change the HTML in the view.php file so that you page lists looks the way you want it. I didn't change anything and this is how mine looks ( image 4 )
Ekko replied on at Permalink Reply
Ekko
Awesome stuff, thanks very much for this it will be put to good use.
daevision replied on at Permalink Reply
edit: for some reason you have to delete the page list block and put it back again for it to work ... just happen to me lol.

Glad it helped , cheers!
jordanlev replied on at Permalink Reply
jordanlev
The image attribute is not in the default setup because the new template (the one with all the helpful comments about adding attributes) was only recently put in, and I wanted to maintain backwards compatibility with all of the old sites out there that did not have the image attribute thing in them.
Also, you cannot assume that people will have those image attributes on their pages so I think that's the reasoning behind not having it enabled by default.

But I agree with you that it's extremely useful, which is why I put all that stuff in there.
daevision replied on at Permalink Reply
Yeah I'm glad you did put it in there , it was totally a life saver. Very cool. Also I see what you mean about backwards compatibility. I ended up modifying it myself for the same reason , I now have that packaged in when ever I install C5 and what I've done is just check to see if there is an image then I use one block of html or another. Just added an if statement to see if $thumb->src was empty.
zoinks replied on at Permalink Reply
* post deleted *