Files
cms-SiteForge/themes/trade-pro/pages/search.html
T
浅念 391d22f1a8 feat: refine trade-pro variant pages (brand/service/faq/search/notfound)
Task 11 (layout port finale): rebuild the five thin variant pages in the
sf-tp design language, informed by upstream industrial/automotive
1.3.0/1.4.0 information architecture.

- brand: page-hero (breadcrumb Home > Brands > name, cover bg, anchor
  button) + related-product card grid (fields.brand == page title) +
  brand profile body only when authored; derived placeholder summary
  excluded, empty brands get an empty state, never fabricated intros.
- service: page-hero + 1.2/0.8 detail grid (article-body typography +
  sticky CTA card with contact/back links); empty body collapses to a
  centered solo column with the CTA card kept.
- faq: page-hero + article-body for the rich-text body (platform has no
  faq content type; sanitize strips details/summary so the typography
  layer carries it, block-driven details coexist via sf-canvas) +
  dark contact-guidance card; empty body swaps to an empty state.
- search: adopts the same platform mechanism as all four upstream
  themes (site-runtime.js ?q= client search over dist-root
  search-index.json); #sf-search/#sf-search-results/#sf-search-count
  hooks and .sf-search-page kept as JS contract, panel and injected
  result cards restyled via scoped cms-token overrides.
- notfound: branded dark-band 404 (icon macro, giant 404 h1, English
  copy, back-home + browse-products buttons); no end-cta.

CSS: Task 11 block appended to pro.css (new sf-tp-* classes only, own
900/620 media queries; shared hero/grid/typography responsive rules
come from existing 10a/10c/10d blocks; search overrides beat
factory.css by specificity without touching hooks).

Tests: test_trade_pro_variant_pages_structure covers brand fixture
(related filtering, empty forms), service/faq body-vs-empty, search
mechanism contract + noindex + index asset, 404 structure, v3 spot
checks (single h1, chrome, SVG arrows) and clean build report.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-26 16:32:15 +08:00

32 lines
2.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{# trade-pro search — 站内搜索页精修(Task 11)。
机制决策:采用与上游四主题完全相同的平台静态检索机制(V8.31 起全主题
共享,非 automotive 专属)——构建器为每个构建打包 search-index.json
(全站条目标题/摘要/类型/品牌),site-runtime.js 在客户端完成 ?q= 深链
读取 + 关键词过滤 + 结果渲染,无任何服务端 API。JS 寻址的是 ID 钩子
(#sf-search 输入 / #sf-search-results 容器 / #sf-search-count 计数,
factory.css 的 .sf-search-page 提供基线观感)——三钩子与 .sf-search-page
类名必须原样保留(平台契约),否则检索退化为一页死输入框。
本模板的精修是观感层:hero 换 sf-tp-page-hero(10c 内页 hero 同款浅
品牌横幅,搜索是工具页无层级——不带面包屑,与上游一致),搜索面板由
pro.css 的 Task 11 作用域规则把 factory.css 的 system-ui 基线覆写为
cms 令牌观感(含 site-runtime.js 注入的 .sf-search-result 结果卡)。
构建器生成本页时 kind='search'(route 推断先于显式模板),robots 为
noindex,follow;pro.html 对 search 页不渲染结尾 CTA 带。页面为英文
(构建器的中文页题「站内搜索」仅进 <title>,不进正文)。 #}
<section class="sf-tp-page-hero sf-tp-search-hero">
<div class="sf-tp-page-hero-overlay" aria-hidden="true"></div>
<div class="wrap">
<div class="sf-tp-page-hero-copy" data-reveal>
<span class="eyebrow">SEARCH / CONTENT</span>
<h1>Site Search</h1>
<p class="sf-tp-page-hero-lead">Search products, brands, news and cases across this site.</p>
</div>
</div>
</section>
<main id="main-content" class="sf-search-page sf-tp-search-panel">
<label for="sf-search">Enter a keyword</label>
<input type="search" id="sf-search" placeholder="Search products, brands, news, cases..." autofocus>
<div id="sf-search-count" aria-live="polite"></div>
<div id="sf-search-results"></div>
</main>