Structure
The following is a basic overview of the setup and structural components used for Klevus Template JS.
On the webpage, a placeholder HTML <div> with is assigned class="klevuLanding" as the target for displaying the search results interface.
e.g.
A small configuration is used for credentials and other variables specific for the implementation. See Configuration for details.
e.g.
The following JavaScript files are referenced within the web page to facilitate the corresponding implementation.
Klevu Template JS Core:
Quick Search:
Search Results Landing Page:
Category/Collection Landing Pages:
Recommendations Widgets/Banners:
Note: Recommendations requires an alternate display target <div> that is configured within the Klevu Merchant Center. See the Getting Started with Recommnedations guide for more details.
The basic consolidated foundation for a Search Result Landing Page would look something like this...
Klevu Template JS is built on a framework of reusable micro-templates.
The Klevu templates are a scripted combination of javascript and HTML. They are built upon a proprietary templating engine to avoid conflicts with other Javascript frameworks.
Data objects are passed to the script block and used for logic as well as printable expressions.
Please see Template Engine for further details about data elements and options
The following .tpl files are automatically pulled into the corresponding theme javascript during injection. They are listed here to be used as an un-minified reference only.
Note: When viewing these in the browser, use view-source to see the templates raw markup
Quick Search:
Search Results Landing Page:
Category/Collection Landing Pages:
Please see Template Reference for further details
The following CSS file is automatically pulled into the corresponding theme javascript during injection.
Note: The additional .debug within the filename is the un-minified version used for reference only. Remove the .debug for production use.
Quick Search:
Search Results Landing Page:
Category/Collection Landing Pages:
See : Styling CSS for further details
The Klevu Template JS includes the necessary analytics reporting for searches and product clicks.
Depending on the implementation, checkout data reporting will need to be added. For the platforms supported by Klevus App/Plug-ins order data tracking is already included.
See : Analytics/Tracking for further details
.