Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Custom Search Results Page

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 322 Views
  • JefersonPaz
    Community Member
    3 Posts

    Custom Search Results Page Link to this post

    Hello, I'm having some troubles generating a custom searh results page, my content is pretty much huge images, and all of them with alternative texts as tags for the search, but the results are spilled out as an huge list of really big images, all in one page. All I need is that I could set 3 full image results (full page content), and all the others was a text with a thumbnail aside (pretty much a list with thumbnails). Can anyone enlighten me?

    the code:

    <script type="text/javascript">

    var _gaq = _gaq || [];
    '$CurrentMember.FirstName $CurrentMember.Surname',
    _gaq.push(['_setAccount', 'UA-38537736-1']);

    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

    <div id="buscaestilo">
       <% if Results %>
        <ul id="SearchResults">
        <% control Results %>
        <% if MenuTitle %>
        <h3><a class="searchResultHeader" href="$Link">$MenuTitle</a></h3>
        <% else %>
        <h3><a class="searchResultHeader" href="$Link">$Title</a></h3>
        <% end_if %>
              <% if Content %>
              <% end_if %>

        <div id="buscaestilo2"><a class="readMoreLink" href="$Link" title="Leia maid sobre &quot;{$Title}&quot;">Leia mais sobre &quot;{$Title}&quot;...</a></div>

    <div class="clear"></div>
    <div class="clear"></div><br><br>
        <% end_control %>
    <div class="clear"></div>
    <div class="clear"></div><br><br>
        <% else %>

                <%-- Example of a translatable string (see http://doc.silverstripe.org/i18n) --%>
                <% _t("Page_results.ss.NORESULTS", "Sorry, your search query did not return any results.") %>
                <%-- By the way, template comments marked like this will be excluded from the HTML output --%>
        <% 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 %>
        <% control Results.SummaryPagination(5) %>
        <% if CurrentBool %>
        <% else %>
        <a href="$Link" title="View page number $PageNum">$PageNum</a>
        <% end_if %>
        <% end_control %>

        <% end_if %>

    Thanks in advice.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.