# Westgate live pages — theme integration spec This covers the parts that live in the **theme repo** (`nodebb-theme-westgate`), not in ACP widgets: - **News** (`/category/1/...`) and **Dev Blog** (`/category/84/...`) — rendered as banner-led article lists + article pages, pulled live from the forum. - **Gallery** — a player-upload screenshot category rendered as a masonry grid. - **Top bar** — global header partial that replaces the left sidebar. The static pages are NOT here. Home now lives in the `nodebb-plugin-westgate-pages` repo as `templates/home.tpl` (sow-* classes, styled by `scss/westgate/_pages.scss`); Join the Team still ships as the paste-ready HTML widget `westgate-pages/join-the-team.html`. --- ## 0. One SCSS partial for all live pages Create `scss/westgate/_pages.scss` and add it to `theme.scss`: ```scss // theme.scss (add after _widgets, before _responsive) @import "./scss/westgate/pages"; ``` All page styles use the existing `--wg-*` tokens — no new colours. Scope every rule under a body/template class so forum chrome is untouched. Suggested top-level hooks (added in the template overrides below): - `body.wg-cat-news`, `body.wg-cat-blog` — the News / Dev Blog category index - `body.wg-article-news`, `body.wg-article-blog` — an individual post - `body.wg-gallery` — the Gallery category index --- ## 1. Category index re-skin (News / Dev Blog) NodeBB renders a category at `categories/category.tpl` (we already override `category.tpl`). Rather than fork the whole template, branch on the category id and render a "cards" layout for cid 1 & 84, falling back to the normal list otherwise. ### 1a. Tag the body (lib/theme.js → filterMiddlewareRenderHeader or a new hook) Add a body class so SCSS can target these categories. In `lib/theme.js`, extend the existing `filterMiddlewareRenderHeader` (or add `filter:category.build`): ```js // lib/theme.js const NEWS_CIDS = { 1: 'news', 84: 'blog' }; library.filterCategoryBuild = async function (hookData) { const cid = hookData.templateData && hookData.templateData.cid; if (NEWS_CIDS[cid]) { hookData.templateData.bodyClass = (hookData.templateData.bodyClass || '') + ' wg-cat-' + NEWS_CIDS[cid]; hookData.templateData.wgArticleList = true; // template flag } return hookData; }; ``` Register it in `plugin.json` hooks: ```json { "hook": "filter:category.build", "method": "filterCategoryBuild" } ``` (If `filter:category.build` isn't available in your NodeBB version, set the flag in the existing `filter:middleware.renderHeader` by inspecting `req.url`.) ### 1b. Template branch (templates/category.tpl) At the top of the topic loop, wrap the Westgate card markup behind the flag. Each topic already exposes `title`, `slug`, `timestamp`/`timestampISO`, `teaser`, `user`, and `thumb` (topic thumbnail) — that's everything the card needs. ```html {{{ if wgArticleList }}}