Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Form Questions

Site Search Results Page - Some Issues...


Reply

4 Posts   2424 Views

Avatar
HenryE

7 April 2009 at 9:03pm (Last edited: 7 April 2009 9:03pm), Community Member, 6 Posts

I recently followed some of the examples to fine tune the search results page. I should mention that I am much more of a designer than a coder.

Firstly, I was wondering if anyone out there knows how to tweak the code, to add a style to every situation in the results of the word that has been searched for. For example when you search for a word in google, in the results that are returned the word is styled in bold. Another example is in these forum searches, where the words appear highlighted. - I think this would add a lot to the search facility.

I also have another problem where for some reason line breaks are being inserted into some of my resulting paragraphs, but not ones that come from my blog pages. - I can not figure out what is causing this.

Also, if images or flash elements are at the top of the pages returned, fragments of these elements are appearing in the search results, and it would be great if there was an easy way to omit them, but I'm not sure how.

The code I am using for the Page_results.ss file is as follows:

<div class="typography">
   <% if Results %>
    <ul id="SearchResults">
    <% control Results %>
    <li>
          <% if Content %>
       $Content.FirstParagraph(html)
          <% end_if %>
    <a class="readMoreLink" href="$Link" title="Read more about "{$Title}"">Read more about "{$Title}"...</a>
    </li>
    <% end_control %>
    </ul>
    <% else %>
    <p>Sorry, your search query did not return any results.</p>
    <% end_if %>

    <% if Results.MoreThanOnePage %>
    <div id="PageNumbers">
    <% if Results.NotLastPage %>
    <a class="next" href="$Results.NextLink" title="View the next page">Next</a>
    <% end_if %>
    <% if Results.NotFirstPage %>
    <a class="prev" href="$Results.PrevLink" title="View the previous page">Prev</a>
    <% end_if %>
    <span>
    <% control Results.SummaryPagination(5) %>
    <% if CurrentBool %>
    $PageNum
    <% else %>
    <a href="$Link" title="View page number $PageNum">$PageNum</a>
    <% end_if %>
    <% end_control %>
    </span>

    </div>
    <% end_if %>
</div>

Anyway, if anyone can help or point me in the right direction it would be much appreciated.
[url]http://www.henryegloff.com.au[/url]

Avatar
FnC/odontodactylus

3 October 2009 at 7:17pm Community Member, 7 Posts

About your linebreak problem: You might want to add

#SearchResults p {
   padding:0;
   margin:0;
}

#SearchResults li br {
   display:none;
}

to your css. That display:none will get rid of the linebreak, though it looks a little ugly as no space is inserted.

Avatar
HenryE

3 October 2009 at 8:30pm Community Member, 6 Posts

Hi odontodactylus,

Thanks heaps for the tip. - I'll check it out.

/H.

Avatar
Lucyjamm

21 January 2010 at 4:44am Community Member, 6 Posts

Thank you, that css tip worked for me, has gotten rid of huge gaps between lines - very glad to have finally fixed that as it was getting on my nerves somewhat!!!