SOLVED: Pagelist blog image not showing
Permalink
Hi,the image in my blog is not showing? Please help!
I created the following template for the pagelist:
and made a imageblock in default blog page and added it to composer, called the block "Thumbnail Image".
Everythink is showing and the image is shown on the page itself but not in the pagelist template...
I created the following template for the pagelist:
<?php defined('C5_EXECUTE') or die("Access Denied."); $textHelper = Loader::helper("text"); $imgHelper = Loader::Helper('image'); if (count($cArray) > 0) { ?> <?php for ($i = 0; $i < count($cArray); $i++ ) { $cobj = $cArray[$i]; $target = $cobj->getAttribute('nav_target'); $title = $cobj->getCollectionName(); $date = $cobj->getCollectionDatePublic('j M Y'); ?> <li><div class="overlay"> <h1><?php echo $title?></h1> <h2><?php echo $cobj->getAttribute('subtitel') ?></h2> <p><a class="leesmeer" <?php if ($target != '') { ?> target="<?php echo $target?>" <?php } ?> href="<?php echo $nh->getLinkToCollection($cobj)?>">Bekijk dit project</a></p>
Viewing 15 lines of 55 lines. View entire code block.
and made a imageblock in default blog page and added it to composer, called the block "Thumbnail Image".
Everythink is showing and the image is shown on the page itself but not in the pagelist template...
![planist1](/files/avatars/67854.jpg)
What is the html the pagelist is giving you? Can you provide the outputted page html?
Hello Planist1,
Here it searches for the block "Thumbnail Image".
In the default blog page I created a image block to and called the block "Thumbnail Image" and made it editable by composer.
The weird thing is that i used this code before in other projects, but it won't show the image now… and I can't find the error..
this is the link to the pagehttp://bit.ly/1hTHiUk you should see a image… when you hover over the block it shows you some text.
So it is showing everything except the image.
Maarten
Here it searches for the block "Thumbnail Image".
<?php $ts = $cobj->getBlocks('Thumbnail Image'); if (is_object($ts[0])) { $tsb = $ts[0]->getInstance(); $thumb = $tsb->getFileObject(); if($thumb){ $imgHelper->outputThumbnail($thumb, 630, 435, $title); } }
In the default blog page I created a image block to and called the block "Thumbnail Image" and made it editable by composer.
The weird thing is that i used this code before in other projects, but it won't show the image now… and I can't find the error..
this is the link to the pagehttp://bit.ly/1hTHiUk you should see a image… when you hover over the block it shows you some text.
<li class="active"><div class="overlay"> <h1>Moderne tuin</h1> <h2>architectonisch met bijzondere vormen</h2> <p><a class="leesmeer" href="THE LINK">Bekijk dit project</a></p> <a href="THE LINK"> </a> </div></li>
So it is showing everything except the image.
Maarten
I can not figure out what is going wrong. I deleted all HTML/CSS/JS and left only the block,.. still no image so ewe can exclude the template is wrong.
I think the pagelist template stated in my starting post is fine to because I used it before,.. I only change some div, li's and styles.
So, in the block map I have got a map
page_list > templates > custom template (see first post)
image > composer > Thumbnail (see below)
Page types: In the blog page I changed the page defaults. I added a content area and added it to composer. Then I added a basic image block, included the block to composer and gave the Block name: "Thumbnail Image", and the custom composer template: "Thumbnail"
When I post a new item everything shows up on the item page.
On other pages with the pagelist (custom template) it shows everything except the image..
Any ideas what is going wrong and how I can find a solution?
I think the pagelist template stated in my starting post is fine to because I used it before,.. I only change some div, li's and styles.
So, in the block map I have got a map
page_list > templates > custom template (see first post)
image > composer > Thumbnail (see below)
<?php defined('C5_EXECUTE') or die("Access Denied."); if(!isset($width)) { $width = 630; } if(!isset($height)) { $height = 435; } $form = Loader::helper('form'); $html = Loader::helper('html'); $url = Loader::helper('concrete/urls'); if ($controller->getFileID() > 0) { $bf = $controller->getFileObject(); } $bt = BlockType::getByHandle('image'); $dialogurl = $url->getBlockTypeToolsUrl($bt)."/crop_image";
Viewing 15 lines of 62 lines. View entire code block.
Page types: In the blog page I changed the page defaults. I added a content area and added it to composer. Then I added a basic image block, included the block to composer and gave the Block name: "Thumbnail Image", and the custom composer template: "Thumbnail"
When I post a new item everything shows up on the item page.
On other pages with the pagelist (custom template) it shows everything except the image..
Any ideas what is going wrong and how I can find a solution?
Solved the problem..
In the template I put:
Had to be:
Pff,..
In the template I put:
<?php $a= new Area ('Afbeelding'); $a->setBlockLimit(1); $a->display($c); ?>
Had to be:
<?php $a= new Area ('Thumbnail Image'); $a->setBlockLimit(1); $a->display($c); ?>
Pff,..