qumra-engine 2.0.79 → 2.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,7 +13,10 @@ exports.default = new (class SeoExtension {
|
|
|
13
13
|
}
|
|
14
14
|
run({ env, ctx }) {
|
|
15
15
|
const injectionCode = (0, globals_1.getGlobal)("injectionCode");
|
|
16
|
-
|
|
16
|
+
let isIframe = false;
|
|
17
|
+
if (env.getGlobal("isIframe")) {
|
|
18
|
+
isIframe = env.getGlobal("isIframe");
|
|
19
|
+
}
|
|
17
20
|
let scripts = `
|
|
18
21
|
${injectionCode.body}
|
|
19
22
|
`;
|
|
@@ -30,7 +30,6 @@ exports.default = new (class WidgetExtension {
|
|
|
30
30
|
}
|
|
31
31
|
const templates = env.getGlobal("templates");
|
|
32
32
|
const widgets = templates.find((t) => t.key === templateKey)?.widgets || [];
|
|
33
|
-
console.log("🚀 ~ run ~ widgets:", widgets);
|
|
34
33
|
const renderedWidgets = [];
|
|
35
34
|
for (const widget of widgets) {
|
|
36
35
|
const widgetTemplatePath = (0, normalizeWidgetPath_1.normalizeWidgetPath)(widget.widget);
|
|
@@ -12,7 +12,9 @@ const mergeDataMiddleware = async (req, res, next) => {
|
|
|
12
12
|
}
|
|
13
13
|
const widgets = res.locals.render.engine?.page?.widgets ?? [];
|
|
14
14
|
(0, globals_1.setGlobal)("currency", res.locals.render.globals?.currency);
|
|
15
|
-
|
|
15
|
+
if (res.locals.isIframe) {
|
|
16
|
+
res.locals.env.addGlobal("isIframe", res.locals.isIframe);
|
|
17
|
+
}
|
|
16
18
|
res.locals.env.addGlobal("templates", res.locals.render.engine?.templates);
|
|
17
19
|
res.locals.env.addGlobal("engineData", res.locals.render.engine);
|
|
18
20
|
res.locals.env.addGlobal("widgets", widgets);
|