תשובה Change wording of "No Refinements Available" on advanced search results page SharePoint 2010

  • יום חמישי 24 מאי 2012 16:05
     
     

    Is it possible to change the wording of the message that says, "No Refinements Available" on the advanced search results page in sharepoint 2010? I have found the location in the webpart code where the message is referred to, but its not the actual text in the code. I think its a reference to an XML file that is elsewhere.

    Thanks!

כל התגובות

  • יום שישי 25 מאי 2012 09:39
    מנחה דיון
     
     תשובה קוד כלול

    Hi Zach,

    We can change the No Refinements Available using JavaScript. Please try the following step:

    1. Add a Content Editor Web Part Web Part.
    2. Add following code as its HTML source code.

    <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
    <script typpe="text/javascript">
            $(document).ready(function () {
                var x = document.getElementsByTagName("span");
                var i = 0;
                for (i = 0; i < x.length; i++) {     
    if(x[i].innerHTML=="No refinements available"){
    x[i].innerHTML="changed no value";}}
                });
    </script>

    3. Save the changes and see how it works.

    Thanks & Regards,
    Emir


    Emir Liu

    TechNet Community Support

    • סומן כתשובה על-ידי Zach Welding יום חמישי 31 מאי 2012 12:49
    •  
  • יום שישי 25 מאי 2012 14:57
     
     

    Hi Emir,

    Thanks for the response. I have added your code to a CEWP on the results page and saved the changes. It still is showing "no refinements availableSelected". Is there another spot in the code where we can change this. It has to be getting the value "no refinements available" from somewhere. Does it have anything to do with <xsl:value-of select="$RefinementPanelCaption" /> from the search page?

    thanks

  • יום שני 28 מאי 2012 02:53
    מנחה דיון
     
     

    Hi Zach,

    Please put the CEWP right below the Search Paging web part and Search Core Result web part and make sure your computer can access Internet so that it can access JQuery package.

    If it still cannot work, I would like suggest you to use IE Explorer Tool to find your HTML tag that the "No refinements available" belong to, and change the script to fit your requirement.

    Thanks & Regards,
    Emir


    Emir Liu

    TechNet Community Support

  • יום חמישי 31 מאי 2012 12:49
     
     תשובה

    I got this to work by using Emir's code. I had to modify it to look as follows:

    <script src="/Scripts/jquery-1.7.2.js" type="text/javascript"></script><script type="text/javascript">

    $(document).ready(function () {
        /*var allParas = document.getElementsByTagName("span");
        var num = allParas.length;
        alert("There are " + num + " <span> elements in this document");
        */

        var x = document.getElementsByTagName("span");
                var i = 0;
                for (i = 0; i < x.length; i++) {
                   if(x[i].innerText=="No refinements available"){
                      x[i].innerText="No filters available";
                   }
                }
    })

         </script>

    • סומן כתשובה על-ידי Zach Welding יום חמישי 31 מאי 2012 12:49
    •