Files
cms-SiteForge/themes/trade-pro/pages/faq.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

57 lines
3.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 faq — FAQ 页精修(Task 11)。
设计参照(本轮无 cms 源对应):上游 industrial/automotive 1.3.0/1.4.0 的
faq 页与 service 共用通用信息页薄形态;本模板以 sf-tp 设计语言定 FAQ
专属口径:sf-tp-page-hero(10c)→ 问题正文(sf-tp-article-body 排版层
双挂,10d)→ 深色引导联系卡(找不到答案 → /contact/,10d 侧栏 CTA
同款深底白按钮语汇)。
数据事实(make_context 对 faq kind):平台无 faq 内容类型——FAQ 页由
普通页面条目承担(meta.page_template='faq' 显式指定,或 /faq 前缀路由
推断),内容 = 单一富文本 body。sanitize 的 ALLOWED_TAGS 不含
details/summary(正文富文本带不进折叠结构);theme.css 的 details/
summary 折叠样式(Task 8)服务的是块系统注入的 custom_blocks(编辑器
faq 块原生 details 渲染在 sf-canvas 区),与本模板正交共存——模板
正文只能走排版层,问题/答案的分节由正文自身 h2/h3 承担(10g/10h 同
决策)。body 为空 → 正文区块整段隐藏换空态卡;引导联系卡恒渲染
(真实动作位)。面包屑/链接指向 /faq/(required_sections 恒保证;
当前页恰为 /faq/ 时自指隐藏)。 #}
<section class="sf-tp-page-hero sf-tp-faq-hero">
{% if safe_image(page.cover) %}<img class="sf-tp-page-hero-bg" src="{{ safe_image(page.cover) }}" alt="" width="1600" height="900" fetchpriority="high" decoding="async">{% endif %}
<div class="sf-tp-page-hero-overlay" aria-hidden="true"></div>
<div class="wrap">
<nav class="sf-tp-breadcrumb" aria-label="Breadcrumb" data-reveal>
<a href="/">Home</a>{% if route != '/faq/' %}<a href="/faq/">FAQ</a>{% endif %}<span class="sf-tp-breadcrumb-current">{{ page.title }}</span>
</nav>
<div class="sf-tp-page-hero-copy" data-reveal style="--reveal-i: 1">
<span class="eyebrow">SUPPORT / FAQ</span>
<h1>{{ page.title }}</h1>
{% if page.summary %}<p class="sf-tp-page-hero-lead">{{ page.summary }}</p>{% endif %}
</div>
</div>
</section>
<section class="section sf-tp-faq">
<div class="wrap">
{% if content %}
<div class="sf-tp-section-head" data-reveal>
<div>
<span class="eyebrow">ANSWERS</span>
<h2>Frequently asked questions</h2>
</div>
</div>
<div class="sf-tp-faq-body sf-tp-article-body" data-reveal style="--reveal-i: 1">{{ body_copy(content, page) }}</div>
{% else %}
<div class="sf-tp-listing-empty" data-reveal>
<h2>No answers published here yet</h2>
<p>Questions added to this page in the admin console appear here automatically.</p>
</div>
{% endif %}
<div class="sf-tp-faq-guide" data-reveal>
<div>
<span class="eyebrow">STILL NEED HELP?</span>
<h3>Can't find your answer?</h3>
<p>Send the question directly — replies within one business day.</p>
</div>
<a class="sf-tp-btn" href="/contact/">Contact us {{ icon('arrow-right') }}</a>
</div>
</div>
</section>