Probleme mit Anzeige der Bilder mit Search Plugin

Phoca Gallery - image gallery extension
User avatar
WM-Loose
Phoca Enthusiast
Phoca Enthusiast
Posts: 60
Joined: 22 Nov 2020, 11:43

Re: Probleme mit Anzeige der Bilder mit Search Plugin

Post by WM-Loose »

Hi Guys,
here is the solution to the problem.
The templates of Joomlaplates use their own component to display the search results.
Please open the template in Joomla and choose this path: https://imgur.com/a/TvlTBBl
Then paste this code:

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 // $result->title should not be escaped in this case, as it may ?>
<?php // contain span HTML tags wrapping the searched terms, if present ?>
<?php // in the title. ?>
<?php echo $result->title; ?>
</a>
<?php else : ?>
<?php // see above comment: do not escape $result->title ?>
<?php echo $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; ?>
<?php if (isset($result->image) && $result->image != '') {
echo '<div style="clear:both"></div>';
} ?>
<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 endforeach; ?>
</dl>
<div class="pagination">
<?php echo $this->pagination->getPagesLinks(); ?>
</div>

Now the images are also displayed as a search result.

Tags:
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9112
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Probleme mit Anzeige der Bilder mit Search Plugin

Post by Benno »

Hi,
prima! Diese Lösung ist sicher auch für andere Joomlaplates Nutzer hilfreich. :)

Freundliche Grüße,
Benno
User avatar
WM-Loose
Phoca Enthusiast
Phoca Enthusiast
Posts: 60
Joined: 22 Nov 2020, 11:43

Re: Probleme mit Anzeige der Bilder mit Search Plugin

Post by WM-Loose »

Ja, das denke ich auch aber ohne Dich hätte ich das wirklich nicht hinbekommen.
Nochmals vielen Dank und #bleib gesund!
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9112
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Probleme mit Anzeige der Bilder mit Search Plugin

Post by Benno »

Danke!

Feundliche Grüße,
Benno
Post Reply