http://prntscr.com/esk9l0
hello guys i want to display images in the search results but they wont show up. i followed the instructions in documentation but no luck. the link above is the picture ofmy code and how i edited it. i do not know but maybe its wrong so check it out and tell me if i did what i was supposed to do, cause the images are not showing up
http://prntscr.com/eskaha
displaying images in phoca search resultsresults
-
- Phoca Member
- Posts: 19
- Joined: 13 Feb 2017, 03:37
- Jan
- Phoca Hero
- Posts: 47810
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: displaying images in phoca search resultsresults
Hi, did you follow this guide:
https://www.phoca.cz/documents/15-phoca- ... ch-results
Do you use the Phoca Gallery latest version?
Jan
https://www.phoca.cz/documents/15-phoca- ... ch-results
Do you use the Phoca Gallery latest version?
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 19
- Joined: 13 Feb 2017, 03:37
Re: displaying images in phoca search resultsresults
yes i am using latest version of phoca,downloaded straignt from here
-
- Phoca Member
- Posts: 19
- Joined: 13 Feb 2017, 03:37
Re: displaying images in phoca search resultsresults
http://prntscr.com/f0wcdv
here is a picture of my code did i do it right?please tell me if i did it right
better still here is my code
<?php
/**
* @package Joomla.Site
* @subpackage com_search
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<dl class="search-results<?php echo $this->pageclass_sfx; ?>">
<?php foreach ($this->results as $result) : ?>
<?php if (isset($result->image) && $result->image != '') {
echo '<div style="float: left;margin: 5px 10px;"><img src="'. $this->escape($result->image).'" alt="" /></div>';
} ?>
<dt class="result-title">
<?php echo $this->pagination->limitstart + $result->count . '. ';?>
<?php if ($result->href) >
<a href="<?php echo JRoute::_($result->href); ?>"<?php if ($result->browsernav == 1) > target="_blank"<?php endif;?>>
<?php echo $this->escape($result->title);?>
</a>
<?php else:?>
<?php echo $this->escape($result->title);?>
<?php endif; ?>
</dt>
<?php if ($result->section) : ?>
<dd class="result-category">
<span class="small<?php echo $this->pageclass_sfx; ?>">
(<?php echo $this->escape($result->section); ?>)
</span>
</dd>
<?php endif; ?>
<dd class="result-text">
<?php echo $result->text; ?>
</dd>
<?php if ($this->params->get('show_date')) : ?>
<dd class="result-created<?php echo $this->pageclass_sfx; ?>">
<?php echo JText::sprintf('JGLOBAL_CREATED_DATE_ON', $result->created); ?>
</dd>
<?php endif; ?>
<?php if (isset($result->image) && $result->image != '') {
echo '<div style="clear:both"></div>';
} ?>
<?php endforeach; ?>
</dl>
<div class="pagination">
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
here is a picture of my code did i do it right?please tell me if i did it right
better still here is my code
<?php
/**
* @package Joomla.Site
* @subpackage com_search
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<dl class="search-results<?php echo $this->pageclass_sfx; ?>">
<?php foreach ($this->results as $result) : ?>
<?php if (isset($result->image) && $result->image != '') {
echo '<div style="float: left;margin: 5px 10px;"><img src="'. $this->escape($result->image).'" alt="" /></div>';
} ?>
<dt class="result-title">
<?php echo $this->pagination->limitstart + $result->count . '. ';?>
<?php if ($result->href) >
<a href="<?php echo JRoute::_($result->href); ?>"<?php if ($result->browsernav == 1) > target="_blank"<?php endif;?>>
<?php echo $this->escape($result->title);?>
</a>
<?php else:?>
<?php echo $this->escape($result->title);?>
<?php endif; ?>
</dt>
<?php if ($result->section) : ?>
<dd class="result-category">
<span class="small<?php echo $this->pageclass_sfx; ?>">
(<?php echo $this->escape($result->section); ?>)
</span>
</dd>
<?php endif; ?>
<dd class="result-text">
<?php echo $result->text; ?>
</dd>
<?php if ($this->params->get('show_date')) : ?>
<dd class="result-created<?php echo $this->pageclass_sfx; ?>">
<?php echo JText::sprintf('JGLOBAL_CREATED_DATE_ON', $result->created); ?>
</dd>
<?php endif; ?>
<?php if (isset($result->image) && $result->image != '') {
echo '<div style="clear:both"></div>';
} ?>
<?php endforeach; ?>
</dl>
<div class="pagination">
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
- Jan
- Phoca Hero
- Posts: 47810
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: displaying images in phoca search resultsresults
Hi, the code needs to be tested, it is hard for everybody to say that some code on screenshot is wrong or right
Didn't you test the code?
Jan
Didn't you test the code?
Jan
If you find Phoca extensions useful, please support the project