--- title: Edit the content of a result template slug: '2834' canonical_url: https://docs.coveo.com/en/2834/ collection: coveo-for-sitecore-v5 source_format: adoc --- # Edit the content of a result template > **Legacy feature** > > The Coveo Hive Framework is now in maintenance mode and is no longer recommended for new implementations. > > To build new search experiences, use one of Coveo's more modern, lightweight, and responsive libraries. > To get started, see the [Build search](https://docs.coveo.com/en/2473/) article. [Result templates](https://docs.coveo.com/en/413/) dictate the way that search results are displayed in your search interface. Although Coveo for Sitecore provides a couple of result template options out of the box, these don't necessarily display the specific information you want your website visitors to see in their search results. You should already know how to create a new result template and how to specify conditions on that template which determine when it's used (see [Create and make use of a new result template](https://docs.coveo.com/en/2173/)). The goal of this article is to help you edit the content of a custom result template `.cshtml` file, understanding that you can mix both server-side and client-side code in your file. For the client-side code, the article will guide you in: * Displaying specific field values in results. * Leveraging the recommended [Coveo JavaScript Search Framework](https://docs.coveo.com/en/187/) [components](https://docs.coveo.com/en/413#result-template-components). * Making the most of [Underscore templates](https://docs.coveo.com/en/413#using-the-underscore-engine). ## Server-Side Versus Client-Side Result Template Resolution Coveo for Sitecore result template `.cshtml` files can contain both server-side and client-side code. While server-side code is result-independent, client-side code is evaluated on a per-result basis after a search [query](https://docs.coveo.com/en/231/) has returned results to the search interface. You integrate server-side code in your result template files using [Razor syntax](https://docs.microsoft.com/en-us/aspnet/web-pages/overview/getting-started/introducing-razor-syntax-c). Razor uses the `@` symbol to transition from HTML to C#. For client-side code, Coveo for Sitecore supports [Underscore templates](http://underscorejs.org/#template) and provides a set of [Underscore template methods](#using-underscore-template-methods) specifically designed for use in result template files. Underscore template code is enclosed in `<%` and `%>` delimiters. The following example shows a portion of a `.cshtml` result template file and how it's progressively resolved until it renders only HTML in the visitor browser. **Result template resolution sequence diagram. In step 1, the code example shows the server evaluating `@MyCompany.GetCurrentLanguage()` to `fr`. In step 2, Underscore template code is used to execute JavaScript logic and to output the current item `raw.language` field value (that is, `en`) from the search query JSON response.** ![Result template resolution flow diagram](https://docs.coveo.com/en/assets/images/c4sc-v5/result-templates-server-vs-client-side.svg) ## Analyzing the `default.cshtml` File A good way to understand how to use fields in result templates is to dissect the content of the `Details` section in the `default.cshtml` file and note how each part is rendered in a query result. ![Image showing a sample result template | Coveo for Sitecore 5](https://docs.coveo.com/en/assets/images/c4sc-v5/result-template-details-section-rendering.png) ![Image showing code associated with the sample result template | Coveo for Sitecore 5](https://docs.coveo.com/en/assets/images/c4sc-v5/result-template-details-section-markup.png) The `` element instantiates the Coveo JavaScript Search Framework **CoveoFieldTable** component (see [Coveo FieldTable Component](https://coveo.github.io/search-ui/components/fieldtable.html)). Each `` element in the table is a **FieldValue** component (see [Coveo FieldValue Component](https://coveo.github.io/search-ui/components/fieldvalue.html)). Finally, the `default.cshtml` file code contains **Underscore template** code for client-side computation and output of context-specific data. > **Important** > > Coveo identifies and records clicks on links with `class="CoveoResultLink"` as [click analytic events](https://docs.coveo.com/en/2949#click-documentview). > Ensure you don't remove this class in custom result templates as you'll lose out on capturing usage analytics data. > > Similarly, `
` elements, used as buttons to display document Quick views in an `