Home > widget-integration > FilterAPI > getTemplateParsedById
FilterAPI.getTemplateParsedById() method
Gets template parsed by ID from app configuration.
This method resolves a template by its ID from the TAE app configuration, checking both templateParsed and template properties. Override this method to customize template resolution logic or provide custom templates for specific shops.
Signature:
protected getTemplateParsedById(templateId: string): unknown | null;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
templateId |
string |
The template ID to look up in configuration |
Returns:
unknown | null
The parsed template object or null if not found
Example
Extend to provide custom templates:
window.boostWidgetIntegration.extend('FilterAPI', (FilterAPI) => {
return class CustomFilterAPI extends FilterAPI {
protected getTemplateParsedById(templateId) {
// Use custom template for specific shops
if (templateId === 'custom-shop-template') {
return this.getCustomShopTemplate();
}
return super.getTemplateParsedById(templateId);
}
};
});