Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show intro-image and extra fields in Smart Search results in Joomla

Tags:

joomla

I´m using Joomla Smart Search in my website and I´m want to show intro-image and some extrafields from the article in the search results.

Joomla Smart Search removes any html tags and I want to prevent to do this extra fields

like image 875
Marroiak Avatar asked Sep 06 '25 03:09

Marroiak


2 Answers

in www\plugins\finder\content open content.php then search for getListQuery , at the end of ->select list add ->select('a.images AS image'); save & close the file

in www\components\com_finder\views\search\tmpl open default_result.php then search for class="result-title after the tag add these lines:

<?php $image=json_decode($this->result->image); ?>
<?php $aimage=$image->image_intro; ?>   
<div class="search-img">
<a href="<?php echo JRoute::_($route); ?>">
<img src="/<?php echo $aimage; ?>" >
</a>
</div>

save & close

dont forget to purge & reindex the smart search

like image 73
Mehdi Shahsavarian Avatar answered Sep 07 '25 22:09

Mehdi Shahsavarian


Smart search plugins say which fields should be indexed. You could replace some of the smart search plugins with ones of your own.

like image 40
Elin Avatar answered Sep 07 '25 23:09

Elin