/
Example: Extending pagination tool with custom markup
Example: Extending pagination tool with custom markup
Steps to extend
Navigate to the directory of the currently active widget template (e.g. Mvc\Views\Hawksearch\Hawksearch.Default.cshtml or the relevant resource package).
Copy the file of the base template or select an existing one.
Edit the file adding or replacing the template override for the pager component:
<script id="vue-hawksearch-pager" type="x-template"> <div class="hawk-pagination__controls"> <template v-if="isLink"> <a class="hawk-pagination__item" :href="previousPageLink"> <left-chevron-svg icon-class="hawk-pagination__left" /> </a> </template> <template v-else> <button class="hawk-pagination__item" @click="goToPreviousPage"> <left-chevron-svg icon-class="hawk-pagination__left" /> </button> </template> <input type="number" :value="page" @change="onChange" :class="hasError ? 'hawk-pagination__input error' : 'hawk-pagination__input'" min="1" :max="totalPages" /> <span class="hawk-pagination__total-text"><span class="break"></span> of {{ totalPages }}</span> <template v-if="isLink"> <a class="hawk-pagination__item" :href="nextPageLink"> <right-chevron-svg icon-class="hawk-pagination__right" /> </a> </template> <template v-else> <button class="hawk-pagination__item" @click="goToNextPage"> <right-chevron-svg icon-class="hawk-pagination__right" /> </button> </template> </div> </script>
Apply the desired structure in this format. The example above adds the contextualized “page“ or “pages“ string after the total pages parameter. Keep in mind that the value and event bindings are required for the proper functioning of the component. Handle their placement with caution.
Include the file in the project.
Save, build and reload the site.
, multiple selections available,
Related content
Example: Extending the results set
Example: Extending the results set
More like this
Example: Extending suggestion components
Example: Extending suggestion components
More like this
Example: Change from pagination to continuous loading
Example: Change from pagination to continuous loading
More like this
Example: Extending the result items with different layout for products and content
Example: Extending the result items with different layout for products and content
More like this
Example: Extending facet selections component
Example: Extending facet selections component
More like this
Example: Extending the tab header
Example: Extending the tab header
More like this