Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

All components in the Vue.js suite are extendable and can be modified to handle custom layout, styles and behaviorbehaviour. This is possible due to the built-in capability of the platform to attach templates as script tag and therefore supplying a dynamic structure of the presentation.

...

This document provides information regarding the template extension of the Hawksearch results widget and it’s its layout and style customization capabilities.

...

  1. Open the results active widget template for editing. It is located in Mvc\Views\Hawksearch\Hawksearch.Default.cshtml. If a resource package is used, then edit the same path in the ResourcePackages folder. Make sure that this is you are using the correct template.

  2. Place the script tag containing the component’s overridden template in the file.

  3. Save, rebuild and refresh the page.

...

  • Vue.js requires all component templates to have a single root element. Note that all the examples are placed in a single <div>

  • The template is defined by HTML id attribute and there can only be one on a single page. Make sure not to duplicate the template overrides.

  • If there are several Hawksearch widget templates used in different cases, there can be different component templates for each. For instance, if you need a separate structure for a specific list which that has a dedicated widget, apply the custom template override there and use it only for this case.

  • The script tag is not required to be in the widget template where its it's used. A more general approach can be to place all the page specific templates separately and used them for all widgets on this page. This can be implemented with the Embeded Embedded code widget from the Scripts and Styles section.

  • All of Vue.js directives (v-if, v-else, v-else-if, v-show etc.) are applicable in the template override. Vue.js Directives