Thumbnail to block Page List ?
Permalink
How can I hang thumbnail to block Page List. what I need to generate is a list containing Thumbnail, Title and Description in Concrete5.3.1.
I made a tutorial about thishttp://www.codeblog.ch/2009/03/concrete5-templates/...
Many thanks Remo
The tutorial above doesn't seem to work in 5.3.1 I can't seem to get the thumbnail to load from this tutorial. Is there an update for the latest version?
This is the code I'm using for the custom template page. But when I set this in my news page as an atribute it doesn't show the picture 'thumbnail' i've specified.
This is the code I'm using for the custom template page. But when I set this in my news page as an atribute it doesn't show the picture 'thumbnail' i've specified.
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); $textHelper = Loader::helper("text"); // now that we're in the specialized content file for this block type, // we'll include this block type's class, and pass the block to it, and get // the content if (count($cArray) > 0) { ?> <div class="ccm-page-list"> <?php for ($i = 0; $i < count($cArray); $i++ ) { $cobj = $cArray[$i]; $title = $cobj->getCollectionName(); ?> <h3><a href="<?php echo $nh->getLinkToCollection($cobj)?>"><?php echo $title?></a></h3> <div class="ccm-page-list-description"> <?php if($cobj->getAttribute('thumbnail')): ?>
Viewing 15 lines of 39 lines. View entire code block.
wouldn't shock me if it was a 5.3.2 specific solution.... 5.3.3 isn't far away.
-frz
-frz
Try something like:
$val = $cobj->getCollectionAttributeValue('thumbnail'); $imgHelper = Loader::helper('image'); $thumb = $imgHelper->getThumbnail($val, 100,100); echo $thumb->src;
Sorry I'm a bit of a newbie - where does this go could you please add this to the code block I've posted in the right place please. I still can't get it to work....
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); $textHelper = Loader::helper("text"); $imgHelper = Loader::helper('image'); // now that we're in the specialized content file for this block type, // we'll include this block type's class, and pass the block to it, and get // the content if (count($cArray) > 0) { ?> <div class="ccm-page-list"> <?php for ($i = 0; $i < count($cArray); $i++ ) { $cobj = $cArray[$i]; $title = $cobj->getCollectionName(); $thumb = $cobj->getCollectionAttributeValue('thumbnail'); if ($thumb) $thumb = $imgHelper->getThumbnail($thumb, 100,100);
Viewing 15 lines of 43 lines. View entire code block.
Thanks for posting this matogertel but have put it in my custom template News.php and specified it in my news page but its still not calling in the thumb. Have followed the tutorial above to the letter and then put in your code for the template.
http://www.psychotherapy-brighton.com/cms/index.php?cID=68...
What I'd really like to do is have different thumbs for each news story and then there being a full pic on the next page and the full story. A bit like a news page. Any ideas?
http://www.psychotherapy-brighton.com/cms/index.php?cID=68...
What I'd really like to do is have different thumbs for each news story and then there being a full pic on the next page and the full story. A bit like a news page. Any ideas?