Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • xumbrella Friend
    #195284

    Hi, I am wondering about the search results page in joomla. I would like it to display search results featuring the searched key word like the home page wall is displayed, rather than a text list of results as is the joomla default, is this possible?

    I see that on your WordPress sister implementation, when you search it returns results in the fashion:

    http://demo.designwall.com/#wallpress
    http://demo.designwall.com/#dw-wall

    thanks

    Wall Crasher Developer
    #524970

    @ xumbrella,

    JA Wall does not support grid display for search result. You can get this with following customisation:*

    <?php
    /**
    ** @package Joomla.Site
    ** @subpackage com_search
    ** @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
    ** @license GNU General Public License version 2 or later; see LICENSE.txt
    **/

    // no direct access
    defined('_JEXEC') or die;
    ?>

    <div id="masonry-container" class="search-results<?php echo $this->pageclass_sfx; ?>">
    <?php foreach($this->results as $result) : ?>
    <div class="item">

    <div class="inner item-inner clearfix">
    <div class="item-main clearfix">
    <div class="header item-header clearfix">
    <h2 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; ?>
    </h2>
    </div>

    <?php if ($result->section) : ?>
    <div class="category-name">
    <span class="small<?php echo $this->pageclass_sfx; ?>">
    (<?php echo $this->escape($result->section); ?>)
    </span>
    </div>
    <?php endif; ?>
    <div class="content item-content">
    <?php echo $result->text; ?>
    </div>

    <?php if ($this->params->get('show_date')) : ?>
    <div class="footer item-footer clearfix">
    <div class="result-created<?php echo $this->pageclass_sfx; ?>">
    <?php echo JText::sprintf('JGLOBAL_CREATED_DATE_ON', $result->created); ?>
    </div>
    </div>
    <?php endif; ?>
    </div>
    </div>
    </div>
    <?php endforeach; ?>
    </div>

    <?php
    // Build the additional URL parameters string.
    $urlparams = '';
    if (!empty($this->pagination->_additionalUrlParams))
    {
    foreach ($this->pagination->_additionalUrlParams as $key => $value)
    {
    $urlparams .= '&' . $key . '=' . $value;
    }
    }
    $next = $this->pagination->get('pages.current') * $this->pagination->limit;
    $nextlink = JRoute::_($urlparams . '&' . $this->pagination->prefix . 'limitstart=' . $next);
    ?>

    <div id="page-nav">
    <a id="page-next-link" href="<?php echo $nextlink ?>"></a>
    </div>

    Above is the code to override the default search result to have a grid alike result.

    You can put the php script into the htmlcom_searchdefault_results.php file.*

    For your convenience, I attached the source file here also:
    Please extract to templatesja_wallhtmlcom_search directory.*

    Hope it helps.*


    1. default_form.zip
Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  Wall Crasher 10 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum