我在我的网站中使用 Joomla 智能搜索,我想在搜索结果中显示文章的介绍图片和一些附加字段。
Joomla 智能搜索会删除任何 html 标签,我想阻止执行此额外字段
最佳答案
在www\plugins\finder\content中打开content.php 然后搜索 getListQuery ,在 ->select 列表末尾添加 ->select('a.images AS image'); 保存 &关闭文件
在www\components\com_finder\views\search\tmpl中打开default_result.php 然后在标签后搜索 class="result-title 添加以下行:
<?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>
保存并关闭
不要忘记清除和重新索引智能搜索
关于joomla - 在 Joomla 的智能搜索结果中显示介绍图片和额外字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16604579/