Hi there!
I thought it would be a simple thing, but I can't find out how to change the result list of com_finder. I want to replace the intro image with the main image of an article.
There are a lot of template override tutorials on how to get custom fields in the search results. But I couldn't find any hint on how to display the main image instead.
So here's the code of the original finder result page: seems to get me only the intro image. But I need the main image instead.
I guess I need to make changes in an other file?
Anyone?
Thanks in advance!
Chris
I thought it would be a simple thing, but I can't find out how to change the result list of com_finder. I want to replace the intro image with the main image of an article.
There are a lot of template override tutorials on how to get custom fields in the search results. But I couldn't find any hint on how to display the main image instead.
So here's the code of the original finder result page:
Code:
<?php if ($showImage && isset($this->result->imageUrl)) : ?> <figure class="<?php echo htmlspecialchars($imageClass, ENT_COMPAT, 'UTF-8'); ?> result__image"> <?php if ($this->params->get('link_image') && $this->result->route) : ?> <a href="<?php echo Route::_($this->result->route); ?>"> <?php echo HTMLHelper::_('image', $this->result->imageUrl, $this->result->imageAlt, $extraAttr, false, -1); ?> </a> <?php else : ?> <?php echo HTMLHelper::_('image', $this->result->imageUrl, $this->result->imageAlt, $extraAttr, false, -1); ?> <?php endif; ?> </figure><?php endif; ?>
Code:
HTMLHelper::_('image', ....
I guess I need to make changes in an other file?
Anyone?
Thanks in advance!
Chris
Statistics: Posted by cherchri — Sun Jul 21, 2024 6:49 pm