Search Results

Permalink
Hi,

My company has a site based on version 5.6. We have used the Search feature to enable our customers to do a site wide search. The majority of the content in our site is pulled dynamically using home spun raw block that makes ajax calls to our back end server that returns html that is parked in an IFrame in the final page.

Given that most of our "content" is dynamic there are only a few words on the page that are static. The search results are divided into 3 sections:

1) Header which is a link to the page
2) Text with the search term highlighted
3) Link to the parent of the page

Our issue is that the second part of the result is just a bunch of words mashed together like a paragraph and truncated on either side. It is a little confusing to our staff and customers.

I would like to know if there are options to either:

a) customize or control the verbage in that section, or
b) omit that section from the search results altogether.

Cheers

 
mnakalay replied on at Permalink Reply
mnakalay
Hello,

You could do both using a block template.

What the block does is this (don't worry if you don't understand code, i'll explain and it's going to be clear)
<?php  echo $this->controller->highlightedMarkup($tt->shortText($r->getDescription()),$query)?>


1- getDescription gets the text for the page in which the result exist
2- shortText truncates that description
3- highlightedMarkup puts color on the search terms in the description

Say you do not want to truncate the text you remove shortText like so
<?php  echo $this->controller->highlightedMarkup($r->getDescription(),$query)?>


but then you might end up with the whole page content showing up in your results