Hi folks,
it is strange to me, that a custom page list shows images, if their weblinks are given as an attribute (coverlink). My search result list doesn't show them. See added pic...
I cannot use the code from the page list for the search results.
This causes an alert:Fatal error: Call to a member function getCollectionAttributeValue() on a non-object [...]
<?phpdefined('C5_EXECUTE') or die(_("Access Denied."));?><?phpif(isset($error)){?><?phpecho$error?>
<br/>
<br/>
<?php}?>
<form id="searchQuery" action="<?phpecho$this->url($resultTargetURL)?>" method="get">
<?php$tt= Loader::helper('text');if($do_search){if(count($results)==0){?><?phpecho t('There were no results found. Please try another keyword or phrase.')?><?php}else{?>
<div id="searchResults">
<?phpecho'Total: '.$paginator->result_count;?><?phpforeach($resultsas$r){$currentPageBody=$this->controller->highlightedExtendedMarkup($r->getBodyContent(),$query);$page= Page::getByID($r->getID());$ih= Loader::helper('image');$oPage= Page::getById($r->getID());//the ID of current result$sTitle=$oPage->getCollectionName();$date=$page->getCollectionDatePublic('d. mm Y');if($oThumb=$oPage->getAttribute('page_thumbnail'));//execute the following code if the thumbnail exists ?>
<div id="searchResult">
<div id="res_img" style="float: left;">
<?phpif($page->getAttribute('page_thumbnail')){?>
<img src="<?phpecho$ih->getThumbnail($oThumb,120,150)->src?>" alt="<?phpecho$title?>" />
<?php}else{?><?php}?><?phpif($page->getAttribute('coverlink')){?>
<img width="100px" src="<?phpecho$page->getAttribute('coverlink')?>">
<?php}else{?><?php}?>
</div>
This website stores cookies on your computer. These cookies are used to improve
your website experience and provide more personalized services to you, both on this website and through
other media. To find out more about the cookies we use, see our Privacy Policy.