[object Object]

← back to Wallco Ai

PDP live-theme takeover (/design/:id serving the active theme) now injects htmlHeader global-search + footer + corner-nav, matching themeVariantSend — the live default PDP was shipping raw with no global search

61159ee8b454214d996dbc7ba673f2bee89f37d2 · 2026-06-03 14:24:27 -0700 · Steve Abrams

Files touched

Diff

commit 61159ee8b454214d996dbc7ba673f2bee89f37d2
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jun 3 14:24:27 2026 -0700

    PDP live-theme takeover (/design/:id serving the active theme) now injects htmlHeader global-search + footer + corner-nav, matching themeVariantSend — the live default PDP was shipping raw with no global search
---
 server.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/server.js b/server.js
index 97dc79d..b8fb5c9 100644
--- a/server.js
+++ b/server.js
@@ -12875,7 +12875,16 @@ app.get('/design/:id', (req, res) => {
       ? req.query.theme : null;
     const liveSlug = req.query.classic === '1' ? null : (previewSlug || getActivePdpTheme());
     if (liveSlug && THEME_FILE_MAP[liveSlug]) {
-      return res.type('html').send(injectSmartFixLink(THEME_FILE_MAP[liveSlug], id));
+      let _vhtml = injectSmartFixLink(THEME_FILE_MAP[liveSlug], id);
+      // Add the SAME chrome themeVariantSend injects so the LIVE default theme
+      // (served here via the takeover path) carries the global-search nav +
+      // footer + corner-nav. Without this the live default PDP shipped raw, with
+      // no global search (the /design/:id/<slug> routes were fine — they go
+      // through themeVariantSend). Gated so it's idempotent.
+      if (!/css\/site\.css/.test(_vhtml)) _vhtml = _vhtml.replace(/<head>/i, '<head>\n<link rel="stylesheet" href="/css/site.css">');
+      if (!/site-header/.test(_vhtml)) _vhtml = _vhtml.replace(/<body[^>]*>/i, (m) => `${m}\n${htmlHeader('')}`);
+      if (!/site-footer/.test(_vhtml)) _vhtml = _vhtml.replace(/<\/body>/i, `\n${FOOTER}\n<script src="/corner-nav.js" defer></script>\n</body>`);
+      return res.type('html').send(_vhtml);
     }
   }
 

← f9e64ac PDP themes: route v1-compact/v2-bento/v3-tabs through themeV  ·  back to Wallco Ai  ·  Loop tick 9: corrected auto-curator republish premise (no li 78083e9 →