locked
where to reference external javascript and css in search display templates RRS feed

  • Question

  •  i want to do two modifications to the search results related to 

       1) CSS

       2) Adding Javascript functionality for actions buttons

       Problem Scenario: I have created seperate site collection for enterprise search and i tried to find out the css file for the search results and i found that all classes related to CSS are inheriting from searchv15.css but when i look at the master page of the search i.e. seattle.master i have found only reference to corev15.css but not searchv15.css.

      Problem Description: I am not understanding that which css file i have to refer related to search results and i want to do 3 things.      

      1) I want to reference CSS, Javascript files for search results

      2) how to apply css to perticular div in search results and also for hover panel.

      3) How to create java script functionality for action buttons in preview panel.

                    Kindly let me know any available solutions or procedures.

    Thanks


    Razvi444

    Sunday, November 17, 2013 5:03 AM

Answers

  • Hi,

    You should be able to refer to the Script and the css by including something like this just after the body tag in your Display Template html file

           

    <script>        
            $includeCSS(this.url,"~sitecollection/Styles/testResult.css");
    $includeScript(this.url,"~sitecollection/Scripts/Search.js");

    </script>

    Hope this helps!!

    Regards,

    Sharath


    sharath kumart shivarama

    • Marked as answer by Patrick_Liang Sunday, December 1, 2013 2:52 PM
    Sunday, November 17, 2013 7:00 PM