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
    Avatar
    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 || [];
    _gaq.push(['_setCustomVar',
    1,
    'Username',
    '$CurrentMember.FirstName $CurrentMember.Surname',
    2
    ]);
    _gaq.push(['_setAccount', 'UA-38537736-1']);
    _gaq.push(['_trackPageview']);

    (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);
    })();

    </script>
    <div id="buscaestilo">
       <% if Results %>
        <ul id="SearchResults">
        <% control Results %>
        <li>
        <% 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 %>
           $Content.FirstParagraph(html)
              <% end_if %>
    <br>

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

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

        <p>
                <%-- 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 --%>
             </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>

       
        <% end_if %>
    </div>

    Thanks in advice.

    322 Views
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.