Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Example

The following template shows an example with best fragment for each resource.

<script id="custom-result-item" type="x-template">
    <div class="result-item">
        <p class="result-item-title">{{ getField('title') }}</p>
        <p>{{ result.BestFragments.itemname }}</p>
    </div>
</script>

Example in Sitefinity context. The following template should be used in \ResourcePackages\Bootstrap4\MVC\Views\Hawksearch\Hawksearch.Default.cshtml or any Sitefinity template.

<script id="vue-hawksearch-result-item" type="x-template">
    <div class="media-body sf-media-body">
        <h3>
            <template v-if="link">
                <a :href=link>{{ title }}</a>
            </template>
            <template v-else>
                {{ title }}
            </template>
        </h3>
        <p>
            <span>{{ result.BestFragments.itemname }}</span>
            <span>{{ content }}</span>
        </p>
        <a :href="link">{{ link }}</a>
    </div>
</script>

  • No labels