Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
template.baseTemplate = firstOverride;
} else {
warn(componentName, 'has no overrides or template to extend from!');
return '';
}
} else {
warn('missing baseTemplate', componentName);
return '';
}
}
/**
* The base template is the main template of the component.
*/
const { baseTemplate, overrides } = template;
const parentPlaceholder = Twig.placeholders.parent;
const blocks = {};
/**
* Iterate through template extensions and collect all block overrides.
*/
if (overrides) {
overrides.forEach((override) => {
const templateBlocks = override.render({}, {
output: 'blocks'
});
/**
* Replace the parent placeholder with the parent block.
* This ensures multi level inheritance.
*/
Object.keys(blocks).forEach((blockName) => {