Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8098493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:05:40+00:00 2026-06-05T22:05:40+00:00

I’ve created a tridion web site, now i want to add some search control

  • 0

I’ve created a tridion web site, now i want to add some search control like Google custom search, is there any option provide by tridion for the same?

my option :
i have to create a user contol and implement Google custom search in there then render it on my pages. or any other approach’d be better.

search control (contain text box and a search button) should be able to search text.
search results should be formatted as search engines do.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:05:41+00:00Added an answer on June 5, 2026 at 10:05 pm

    When you say Google, are you talking about the Google Search Appliance (GSA)?

    Assuming that is the case: You seem to have done quite a lot of work with XSLT, so in my opinion the easiest way to do thes is have your usercontrol call the XML API for the GSA with the relevant query, and simply transform the response with XSLT. This prevents you from having to recompile the control when you need layout changes, and you can publish the XSLT from Tridion.

    I use the following XSLT to generate the search results on this page http://medicine.yale.edu/search.aspx?q=test&x=0&y=0&site=YSM_School_of_Medicine

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
        <xsl:output method="html" omit-xml-declaration="yes"/>
        <xsl:param name="SITE_CATALOG"/>
        <xsl:param name="SITE_NAME"/>   
        <xsl:param name="MAX_PAGES_IN_NAVIGATION">10</xsl:param>
        <xsl:param name="TOTALNUMBER" select="/GSP/RES/M"/>
        <xsl:param name="QUERY" select="/GSP/PARAM[@name='q']/@value"/>
        <xsl:param name="SEARCHED_SITE_CATALOG" select="/GSP/PARAM[@name='site']/@value"/>
        <xsl:template match="/">
            <xsl:variable name="STARTNUMBER" select="/GSP/RES/@SN"/>
            <xsl:variable name="ENDNUMBER" select="/GSP/RES/@EN"/>
            <xsl:variable name="TIMER" select="/GSP/TM"/>
            <!--begin search results -->
            <div class="google-search-form bordered-box shaded-f5 padded-20">
                <xsl:call-template name="WriteSearchForm"/>
            </div>
            <xsl:if test="/GSP/Spelling">
                <p>Did you mean <a href="?q={/GSP/Spelling/Suggestion/@q}&amp;site={/GSP/PARAM[@name='site']/@value}">
                        <xsl:value-of select="/GSP/Spelling/Suggestion/@q"/>
                    </a>?</p>
            </xsl:if>
            <div id="search-results-pagination">
    
                <xsl:for-each select="/GSP/RES/R">
                    <xsl:choose>
                        <xsl:when test="@L='2'">
                            <div class="grouped-search-result">
                                <h4>
                                    <a href="{U}">
                                        <xsl:value-of select="T" disable-output-escaping="yes"/>
                                    </a>
                                </h4>
                                <p class="search-result-body">
                                    <xsl:value-of select="S" disable-output-escaping="yes"/>
                                </p>
                                <p class="gray95">
                                    <span class="green">
                                        <xsl:choose>
                                            <xsl:when test="string-length(U) &gt; 88">
                                                <xsl:value-of select="substring(U, 0, 88)"/>...
                                            </xsl:when>
                                            <xsl:otherwise>
                                                <xsl:value-of select="U"/>
                                            </xsl:otherwise>
    
                                        </xsl:choose>
                                    </span>
                                </p>
    
                                <p>
                                    <a href="?as_sitesearch={HN/@U}&amp;q={$QUERY}&amp;site={$SITE_CATALOG}" class="more-results-link">
                                        [ <span>
                                            More results from <xsl:value-of select="HN/@U"/>
                                        </span> ]
                                    </a>
                                </p>
                            </div>
                        </xsl:when>
                        <xsl:otherwise>
                            <div class="pagination-element search-result">
                                <h4><a href="{U}">
    
                                        <xsl:call-template name="WriteMimeTypeIndicator">
                                            <xsl:with-param name="RESULT" select="."/>
                                        </xsl:call-template>
                                        <xsl:value-of select="T" disable-output-escaping="yes"/>
    
                                </a></h4>
                                <p class="search-result-body">
                                    <xsl:value-of select="S" disable-output-escaping="yes"/>
                                </p>
                                <p>
                                    <span class="green">
                                        <xsl:choose>
                                            <xsl:when test="string-length(U) &gt; 92">
                                                <xsl:value-of select="substring(U, 0, 92)"/>...
                                            </xsl:when>
                                            <xsl:otherwise>
                                                <xsl:value-of select="U"/>
                                            </xsl:otherwise>
    
                                        </xsl:choose>
    
                                    </span> - <xsl:value-of select="HAS/C/@SZ"/>
                                </p>
                            </div>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:for-each>
            </div>
            <hr class="dashed" />
    
    <xsl:call-template name="WritePageNavigation"/>
            <!--<div id="pagination-controls" class="pagination-controls float-rt"></div>-->
    
            <!-- end pagination-controls -->
    
    
    
            <div class="results-footer-notes">
    
                <p class="small-gray95">Note: This search service may return results that are not approved by Yale University, or results that may not reflect the official views of Yale University.</p>
    
            </div>
    
    
    
            <div class="clear"></div>
    
            <div class="google-search-form bordered-box shaded-f5 padded-20 big-margin-top">
                <xsl:call-template name="WriteSearchForm"/>
            </div>
            <!-- end search results -->
        </xsl:template>
        <xsl:template name="WritePageNavigation">
            <xsl:variable name="RESULTS_ON_THIS_PAGE" select="count(/GSP/RES/R)"/>
            <xsl:variable name="TOTAL_RESULT_COUNT" select="/GSP/RES/M"/>
            <xsl:variable name="TOTAL_PAGES" select="ceiling($TOTAL_RESULT_COUNT div $RESULTS_ON_THIS_PAGE)"/>
            <xsl:variable name="CURRENT_PAGE" select="floor((/GSP/RES/@SN) div $RESULTS_ON_THIS_PAGE) + 1"/>
            <xsl:variable name="START_RESULT" select="/GSP/RES/@SN"/>
            <!--
    
        Results On This Page: <xsl:value-of select="$RESULTS_ON_THIS_PAGE"/>
            <br/>
        Total Results: <xsl:value-of select="$TOTAL_RESULT_COUNT"/>
            <br/>
        Total Pages: <xsl:value-of select="$TOTAL_PAGES"/>
            <br/>
        Current Page: <xsl:value-of select="$CURRENT_PAGE"/>
            <br/>
        Start Result: <xsl:value-of select="$START_RESULT"/>
            <br/>
        Start Navigation Page: <xsl:value-of select="$CURRENT_PAGE - ($MAX_PAGES_IN_NAVIGATION div 2)"/>
    -->
            <xsl:if test="$TOTAL_PAGES &gt; 1">
                <ul class="google-search-pagination">
    
                    <xsl:if test="$CURRENT_PAGE &gt; 1">
                        <li class="pagination-previous">
                            <a href="?q={/GSP/PARAM[@name='q']/@value}&amp;start={($CURRENT_PAGE - 2)*$RESULTS_ON_THIS_PAGE}&amp;site={/GSP/PARAM[@name='site']/@value}">Previous</a>
                        </li>
                    </xsl:if>
    
    
    
    
    
                    <xsl:call-template name="WritePaging">
                        <xsl:with-param name="CURRENT_PAGE" select="$CURRENT_PAGE"/>
                        <xsl:with-param name="NEXT_PAGE_START" select="$RESULTS_ON_THIS_PAGE + 1"/>
                        <xsl:with-param name="TOTAL_RESULTS" select="$TOTAL_RESULT_COUNT"/>
                        <xsl:with-param name="RESULTS_ON_PAGE" select="$RESULTS_ON_THIS_PAGE"/>
                        <xsl:with-param name="START_PAGE">
                            <xsl:choose>
                                <xsl:when test="($CURRENT_PAGE - ($MAX_PAGES_IN_NAVIGATION div 2)) &gt; 0">
                                    <xsl:value-of select="$CURRENT_PAGE - ($MAX_PAGES_IN_NAVIGATION div 2)"/>
                                </xsl:when>
                                <xsl:otherwise>1</xsl:otherwise>
                            </xsl:choose>
                        </xsl:with-param>
                        <xsl:with-param name="END_PAGE">
                            <xsl:choose>
                                <xsl:when test="($CURRENT_PAGE - ($MAX_PAGES_IN_NAVIGATION div 2)) &gt; 0">
                                    <xsl:value-of select="$MAX_PAGES_IN_NAVIGATION + $CURRENT_PAGE - floor($MAX_PAGES_IN_NAVIGATION div 2) - 1"/>
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:value-of select="$MAX_PAGES_IN_NAVIGATION"/>
                                </xsl:otherwise>
                            </xsl:choose>
                        </xsl:with-param>
                    </xsl:call-template>
    
                    <li class="pagination-next">
                        <a href="?q={/GSP/PARAM[@name='q']/@value}&amp;start={($CURRENT_PAGE)*$RESULTS_ON_THIS_PAGE}&amp;site={/GSP/PARAM[@name='site']/@value}">Next</a>
                    </li>
    
                </ul>
            </xsl:if>
        </xsl:template>
        <xsl:template name="WritePaging">
            <xsl:param name="NEXT_PAGE_START"/>
            <xsl:param name="RESULTS_ON_PAGE"/>
            <xsl:param name="TOTAL_RESULTS"/>
            <xsl:param name="CURRENT_PAGE"/>
            <xsl:param name="START_PAGE"/>
            <xsl:param name="END_PAGE"/>
    <!--
            NEXT_PAGE_START: <xsl:value-of select="$NEXT_PAGE_START"/><br/>
            RESULTS_ON_PAGE: <xsl:value-of select="$RESULTS_ON_PAGE"/><br/>
            TOTAL_RESULTS: <xsl:value-of select="$TOTAL_RESULTS"/><br/>
            CURRENT_PAGE: <xsl:value-of select="$CURRENT_PAGE"/><br/>
            START_PAGE: <xsl:value-of select="$START_PAGE"/><br/>
            END_PAGE: <xsl:value-of select="$END_PAGE"/><br/>
    -->
    
    
            <li>
                <xsl:if test="$CURRENT_PAGE = $START_PAGE">
                    <xsl:attribute name="class">selected</xsl:attribute>
                    <a href="#">
                        <xsl:value-of select="$START_PAGE"/>
                    </a>
                </xsl:if>
                <xsl:if test="$CURRENT_PAGE != $START_PAGE">
                    <a href="?q={/GSP/PARAM[@name='q']/@value}&amp;start={($START_PAGE - 1)*$RESULTS_ON_PAGE}&amp;site={/GSP/PARAM[@name='site']/@value}">
                        <xsl:value-of select="$START_PAGE"/>
                    </a>
                </xsl:if>
            </li>
    
    
    
            <xsl:if test="$START_PAGE &lt; $END_PAGE">
                <xsl:if test="$NEXT_PAGE_START &lt; $TOTAL_RESULTS">
                    <xsl:call-template name="WritePaging">
                        <xsl:with-param name="NEXT_PAGE_START" select="$NEXT_PAGE_START + $RESULTS_ON_PAGE"/>
                        <xsl:with-param name="TOTAL_RESULTS" select="$TOTAL_RESULTS"/>
                        <xsl:with-param name="RESULTS_ON_PAGE" select="$RESULTS_ON_PAGE"/>
                        <xsl:with-param name="START_PAGE" select="$START_PAGE + 1"/>
                        <xsl:with-param name="CURRENT_PAGE" select="$CURRENT_PAGE"/>
                        <xsl:with-param name="END_PAGE" select="$END_PAGE"/>
                    </xsl:call-template>
                </xsl:if>
            </xsl:if>
        </xsl:template>
        <xsl:template name="WriteSearchForm">
            <form name="gs" method="GET" action="#">
                <p class="wrapper">
                    <input type="text" name="q" maxlength="256" value="{$QUERY}" class="google-search-keywords"/>
                    <select name="site" class="google-search-site">
                        <option value="{$SITE_CATALOG}">
                            <xsl:if test="$SEARCHED_SITE_CATALOG = $SITE_CATALOG">
                                <xsl:attribute name="selected">true</xsl:attribute>
                            </xsl:if>
                            <xsl:value-of select="$SITE_NAME" disable-output-escaping="yes"/>
                        </option>
                        <option value="Yale_University">---------------</option>
                        <option value="YSM_School_of_Medicine">
                            <xsl:if test="$SEARCHED_SITE_CATALOG = 'YSM_School_of_Medicine'">
                                <xsl:attribute name="selected">true</xsl:attribute>
                            </xsl:if>
                            School of Medicine
                        </option>
                        <option value="Yale_Medical_Group">
                            <xsl:if test="$SEARCHED_SITE_CATALOG = 'Yale_Medical_Group'">
                                <xsl:attribute name="selected">true</xsl:attribute>
                            </xsl:if>
                            Yale Medical Group
                        </option>
                        <option value="Yale_New_Haven_Hospital">
                            <xsl:if test="$SEARCHED_SITE_CATALOG = 'Yale_New_Haven_Hospital'">
                                <xsl:attribute name="selected">true</xsl:attribute>
                            </xsl:if>
                            Yale-New Haven Hospital
                        </option>
                        <option value="Medical_Center">
                            <xsl:if test="$SEARCHED_SITE_CATALOG = 'Medical_Center'">
                                <xsl:attribute name="selected">true</xsl:attribute>
                            </xsl:if>
                            Medical Center (all)
                        </option>
                        <option value="Medical_Library">
                            <xsl:if test="$SEARCHED_SITE_CATALOG = 'Medical_Library'">
                                <xsl:attribute name="selected">true</xsl:attribute>
                            </xsl:if>
                            Medical Library
                        </option>
                        <option value="Yale_University">---------------</option>
                        <option value="Yale_Libraries">
                            <xsl:if test="$SEARCHED_SITE_CATALOG = 'Yale_Libraries'">
                                <xsl:attribute name="selected">true</xsl:attribute>
                            </xsl:if>
                            Yale Libraries
                        </option>
                        <option value="Finance_and_Administration">
                            <xsl:if test="$SEARCHED_SITE_CATALOG = 'Finance_and_Administration'">
                                <xsl:attribute name="selected">true</xsl:attribute>
                            </xsl:if>
                            Finance &amp; Admin
                        </option>
                        <option value="Human_Resources">
                            <xsl:if test="$SEARCHED_SITE_CATALOG = 'Human_Resources'">
                                <xsl:attribute name="selected">true</xsl:attribute>
                            </xsl:if>
                            Human Resources
                        </option>
                        <option value="ITS">
                            <xsl:if test="$SEARCHED_SITE_CATALOG = 'ITS'">
                                <xsl:attribute name="selected">true</xsl:attribute>
                            </xsl:if>
                            Information Technology
                        </option>
                        <option value="Yale_University">
                            <xsl:if test="$SEARCHED_SITE_CATALOG = 'Yale_University'">
                                <xsl:attribute name="selected">true</xsl:attribute>
                            </xsl:if>
                            Yale University
                        </option>
                    </select>
                    <button type="submit" value="submit" class="google-search-button theme-background">
                        <img src="/files/images/button_search_icon_translucent_sm.png" />Google Search
                    </button>
                </p>
                <p class="no-space-bottom float-rt" style="margin-right:50px;">
                    <a href="http://www.yale.edu/its/web/search/tips.html" class="search-tips">
                        <img src="/files/images/icon_question.gif" alt="" style="vertical-align:middle" />&#160;Search Tips
                    </a>
                </p>
    
                <p class="no-space-bottom gray95">
                    Results <span class="green">
                        <xsl:value-of select="/GSP/RES/@SN"/>
                    </span> - <span class="green">
                        <xsl:value-of select="/GSP/RES/@EN"/>
                    </span> of about <span class="green"><xsl:value-of select="$TOTALNUMBER"/></span> for <strong><xsl:value-of select="$QUERY"/></strong>
                </p>
    
    
            </form>
        </xsl:template>
        <xsl:template name="WriteMimeTypeIndicator">
            <xsl:param name="RESULT"/>
            <xsl:choose>
                <xsl:when test="not($RESULT/@MIME)"></xsl:when>
                <xsl:when test="$RESULT/@MIME = 'application/msword'">[DOC] </xsl:when>
                <xsl:when test="$RESULT/@MIME = 'application/octet-stream'">TEST OPTIONS</xsl:when>
                <xsl:when test="$RESULT/@MIME = 'application/pdf'">[PDF] </xsl:when>
                <xsl:otherwise>TODO:<xsl:value-of select="$RESULT/@MIME"/></xsl:otherwise>
            </xsl:choose>
    
    
        </xsl:template>
    </xsl:stylesheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a French site that I want to parse, but am running into
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.