2013-11-13, 06:28:01
Hi,
I have the rendering component working OK, but can't get my custom image field shown, I can't even get the link text displayed (live site here http://textplusdata.se/)
I have this in the body of my front page:
and this is the component:
$item->blog-thumbnail doesn't seem to call anything and just results in "0" when echoed directly.
Am I doing something wrong? The field definitely exists and works when the search is customised on the Special Page itself using this code:
I have the rendering component working OK, but can't get my custom image field shown, I can't even get the link text displayed (live site here http://textplusdata.se/)
I have this in the body of my front page:
Code:
(% searchresults tags:blog i18n=0 numWords:30 HEADER:'' component:i18n-blog-list-thumbnails %)
and this is the component:
Code:
<h3 class="search-entry-title">
<?php if ($showLanguage) { ?>
<span class="search-entry-language">
<?php echo htmlspecialchars($item->language, ENT_NOQUOTES); ?>
</span>
<?php } ?>
<a href="<?php echo $item->link; ?>">
<?php echo htmlspecialchars($item->title, ENT_NOQUOTES); ?>
</a>
<?php echo '<img src="'; echo ($item->blog-thumbnail);echo '">' ?>
<?php echo ($item->blog-thumbnail); ?>
</h3>
<?php if ($showDate) { ?>
<div class="search-entry-date">
<?php echo strftime($dateFormat, $item->pubDate); ?>
</div>
<?php } ?>
<div class="search-entry-excerpt">
<?php echo $item->getExcerpt($item->content, $numWords); ?>
</div>
<div>[<a href="<?php echo $item->link; ?>">more</a>]</div>
$item->blog-thumbnail doesn't seem to call anything and just results in "0" when echoed directly.
Am I doing something wrong? The field definitely exists and works when the search is customised on the Special Page itself using this code:
Code:
<a href="<?php get_special_field('link','',false); ?>">
<?php if (return_special_field('blog-thumbnail')!='') { echo '<img src="'; get_special_field('blog-thumbnail','',false); echo '">'; } else echo ""; ?>