Header-Footer template render updates.
This commit is contained in:
@@ -163,19 +163,44 @@ export async function RenderTemplates(
|
||||
: "50px",
|
||||
},
|
||||
}),
|
||||
pdfOperations: templateAndData.map((template) => {
|
||||
return {
|
||||
pdfOperations: [
|
||||
{
|
||||
template: {
|
||||
name: template.useShopSpecificTemplate
|
||||
? `/${bodyshop.imexshopid}/${template.templateObject.name}`
|
||||
: `/${template.templateObject.name}`,
|
||||
...(renderAsHtml ? {} : { recipe: "chrome-pdf" }),
|
||||
name: "/components/Header-Footer",
|
||||
recipe: "chrome-pdf",
|
||||
engine: "handlebars",
|
||||
},
|
||||
type: "append",
|
||||
mergeWholeDocument: true,
|
||||
renderForEveryPage: true,
|
||||
};
|
||||
}),
|
||||
type: "merge",
|
||||
},
|
||||
...templateAndData.map((template) => {
|
||||
return {
|
||||
template: {
|
||||
chrome: {
|
||||
marginTop:
|
||||
bodyshop.logo_img_path &&
|
||||
bodyshop.logo_img_path.headerMargin &&
|
||||
bodyshop.logo_img_path.headerMargin > 36
|
||||
? bodyshop.logo_img_path.headerMargin
|
||||
: "36px",
|
||||
marginBottom:
|
||||
bodyshop.logo_img_path &&
|
||||
bodyshop.logo_img_path.footerMargin &&
|
||||
bodyshop.logo_img_path.footerMargin > 50
|
||||
? bodyshop.logo_img_path.footerMargin
|
||||
: "50px",
|
||||
},
|
||||
name: template.useShopSpecificTemplate
|
||||
? `/${bodyshop.imexshopid}/${template.templateObject.name}`
|
||||
: `/${template.templateObject.name}`,
|
||||
...(renderAsHtml ? {} : { recipe: "chrome-pdf" }),
|
||||
},
|
||||
type: "append",
|
||||
|
||||
// mergeWholeDocument: true,
|
||||
// renderForEveryPage: true,
|
||||
};
|
||||
}),
|
||||
],
|
||||
},
|
||||
data: {
|
||||
...extend(
|
||||
|
||||
Reference in New Issue
Block a user