YOOtheme Pro is here! The best WordPress and Joomla theme. Learn more

Avatar john.a.merlino asked

HEADER RESULS IN SEACH SHOWING HTML SPAN TAGS

I have read the post already in and tried that fix, cleared all cache and still am having the issue.

I am also having this same problem. Using Joomla 3.7.5 and the latest WidgetKit and ZOO extensions just uploaded.

Here is the fix suggested:

    <?php  
/** * @package Warp Theme Framework * @author YOOtheme http://www.yootheme.com * @copyright Copyright (C) YOOtheme GmbH * @license http://www.gnu.org/licenses/gpl.html GNU/GPL */  

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

foreach ($this->results as $result) {  

$args = array(    
    'permalink' => '',    
    'image' => '',    
    'image_alignment' => '',    
    'image_alt' => '',    
    'image_caption' => '',    
    'title' => $this->escape(strip_tags($result->title)),    
    'title_link' => '1',    
    'author' => '',    
    'author_url' => '',    
    'date' => '',    
    'datetime' => '',    
    'category' => ($result->section) ? $this->escape($result->section) : '',    
    'category_url' => '',    
    'hook_aftertitle' => '',    
    'hook_beforearticle' => '',    
    'hook_afterarticle' => '',    
    'article' => $result->text,    
    'tags' => '',    
    'edit' => '',    
    'url' => ($result->href) ? JRoute::_($result->href) : '',    
    'more' => '',    
    'previous' => '',    
    'next' => ''    
);  

// Render template    
echo $warp['template']->render('article', $args);  

}  

echo $this->pagination->getPagesLinks();  

Here are my results after updating this code and doing a search for Ham.
MEDITERRANEAN BAKED EGGS in <span class="highlight">ham</span> CUPS

I have also updated the version of SALT to 7.3.4 warp framework
Information
Versions

This theme is based on the Warp framework. Always keep the theme and the Warp framework up-to-date.
Name Version
yoo_salt 1.0.10
Warp Framework 7.3.34
System Check

Warp engine operational and ready for take off.

File Verification

Verification successful, no file modifications detected.

Edited 3 days ago

  • ZOO
  • Salt

Edited

8 Answers

0

Avatar thomas.p Support answered

Thank you. Please try either of these options:

Option 1 Use Smart Search instead

Try to use the module Smart search instead of Search. You once need to activate the plugin Content - Smart Search, then go to Components->Smart Search and lick on Index to make it ready. Then you can use this module type. It should correcty highlight the search results and not show the tags. Please give it a try.

Option 2 Remove Theme Override for Search Results

The default Warp 7 output for search results is overridden by a layout from the Salt theme. Try deleting the file /templates/yoo_salt/layouts/com_search/search/default_results.php. The span tags should be gone. Note that this is not update-safe. In order to get an update-safe change, create a cusotm style and copy the file /templates/yoo_salt/warp/systems/joomla/layouts/com_search/search/default_results.php to /templates/yoo_salt/styles/YOURSTYLE/layouts/com_search/search/default_results.php.

Edited

1

Avatar thomas.p Support answered

I did however notice he ends with a semi-colon when I do that the code is broken.

Yes, the code example you posted is an array and the semicolon would break the array as it is a sign for the end of a statement. So the fix didn't work out for you, correct? Could you please add admin access in the hidden information so that I can have a first hand look?

Edited

0

Avatar thomas.p Support answered

Hi john.a.merlino,

I just tested this fix on a local installation and it worked for me. Did you clear you Joomla cache?

Is the search result that still shows the tags a Joomla article/category or a ZOO item/category?

Kind regards
Thomas

0

Avatar john.a.merlino answered

the header of the recipe search so I am assuming ZOO, if you go to the site nad put in a search you will see it only shows in the title of the search results. http://chefjamie.com I have cleared all cache but I will try it again.

OK so from the admin panel cleared global cache

here are my results

CHICKEN with <span class="highlight">lemon</span>, ORZO &amp; OLIVES  
I love this comforting Mediterranean one-pot meal; perfect for a hearty weeknight meal; and delicious leftovers!

My code block in results

<?php  
/**  
* @package   Warp Theme Framework  
* @author    YOOtheme http://www.yootheme.com  
* @copyright Copyright (C) YOOtheme GmbH  
* @license   http://www.gnu.org/licenses/gpl.html GNU/GPL  
*/  

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

foreach ($this->results as $result) {  

    $args = array(  
        'permalink' => '',  
        'image' => '',  
        'image_alignment' => '',  
        'image_alt' => '',  
        'image_caption' => '',  
        'title' => escape(strip_tags($result->title)) : '',  
        'title_link' => '1',  
        'author' => '',  
        'author_url' => '',  
        'date' => '',  
        'datetime' => '',  
        'category' => ($result->section) ? $this->escape($result->section) : '',  
        'category_url' => '',  
        'hook_aftertitle' => '',  
        'hook_beforearticle' => '',  
        'hook_afterarticle' => '',  
        'article' => $result->text,  
        'tags' => '',  
        'edit' => '',  
        'url' => ($result->href) ? JRoute::_($result->href) : '',  
        'more' => '',  
        'previous' => '',  
        'next' => ''  
    );  

    // Render template  
    echo $warp['template']->render('article', $args);  

}  

echo $this->pagination->getPagesLinks();

But I did try this first: from Hendricks post I did however notice he ends with a semi-colon when I do that the code is broken.

You can fix this by editing the file warp/systems/joomla/layouts/com_search/search/default_results.php, on lines 22 and 24 replace

echo $this->escape($result->title);

with

echo $this->escape(strip_tags($result->title));

Here is the result of the fix, line 22 is the author line as you say to fix line 22 adn 24 line 24 is the date line so this is very confusing to me.

Here is the file as I have it now which does not work.

<?php
/** * @package Warp Theme Framework * @author YOOtheme http://www.yootheme.com * @copyright Copyright (C) YOOtheme GmbH * @license http://www.gnu.org/licenses/gpl.html GNU/GPL */

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

foreach ($this->results as $result) {

$args = array(  
    'permalink' => '',  
    'image' => '',  
    'image_alignment' => '',  
    'image_alt' => '',  
    'image_caption' => '',  
    'title' => escape(strip_tags($result->title)) : '',  
    'title_link' => '1',  
    'author' => '',  
    'author_url' => '',  
    'date' => '',  
    'datetime' => '',  
    'category' => ($result->section) ? $this->escape($result->section) : '',  
    'category_url' => '',  
    'hook_aftertitle' => '',  
    'hook_beforearticle' => '',  
    'hook_afterarticle' => '',  
    'article' => $result->text,  
    'tags' => '',  
    'edit' => '',  
    'url' => ($result->href) ? JRoute::_($result->href) : '',  
    'more' => '',  
    'previous' => '',  
    'next' => ''  
);

// Render template  
echo $warp['template']->render('article', $args);

}

echo $this->pagination->getPagesLinks();

Edited

0

Avatar john.a.merlino answered

I have updated the question with the user name and password for the admin section. Thank you

0

Avatar john.a.merlino answered

I checked my plugins and modules and I am using smart search already. I am going to try and just rename the file default_results.php and see what happens.

So I just renamed the file and ran a search. the search works fine except when the search word is in the actual name of the title of the item. You can see it here.

MEDITERRANEAN BAKED EGGS in <span class="highlight">HAM</span> CUPS

I placed the user and pass in teh hidden would you mind taking a look for me, I am really baffled at this point

OK so I created a new module using the advanced search component. This seemed to work however I lost the auto discovery drop down in the search. On the regular search it searched the whole site, this is asking me for a specific area to search and when leaving that feild (select itemID) blank or the default "it dows not give results for anything.

Anyway this did remove the span tags, so I am closer to a resolution. Have i missed something in the search variables for this to happen, the search results drop down i mean?

Edited

0

Avatar thomas.p Support answered

the search results drop down i mean?

Are you referring to this?

Image

Unfortunately, that's not available with the smart search module in Warp 7 themes, as far as I know. I'm sorry. It should work on the smart search result page, though.

I have fixed the search for you in that way that you won't see the tags anymore, but the word you searched for isn't highlighted as well. I did that by replacing line 20 in /layouts/com_search/search/default_results.php with

    'title' => strip_tags($result->title),

You can switch back to your 'normal' search module to see that.

I have, however, forwarded both question – missing highlight and the AJAX search suggestions – to the developers to check.

Kind regards
Thomas

Edited

0

Avatar thomas.p Support answered

Update The highlight styling in the title for Standard Search shall be fixed in an upcoming release. I don't have an ETA for this, though.

Know someone who can answer? Share a link to this question via email or twitter.