§5.18
FAQ, announcement bar and campaign packages
- Phase 12.3
- theme 1.19.0
Category FAQ — $faq. Arrives on products.wcp (category mode), productdetails.wcp and store.wcp: [{q, a_html}]. q is plain text; a_html is HTML sanitised in the core (printed with {!! !!}). When a sub-category has no questions, the parent's arrive; with no questions an empty list. The core writes the FAQPage data for search engines per page (not on the order page, which is noindex); the theme must not write JSON-LD. The default theme uses the shared includes/faq.wcp partial (native <details>, no script; $faqTitle, $faqId optional).
Home page FAQ section. A new field type faq in the manifest (HomepageSections::FIELDS). The section record is $section['faq']: [{q, a, a_html}] (active language, otherwise the default language). In the default theme the key is faq, the view includes/sections/faq.wcp, off by default and without questions. When the section is on and has questions, the core adds the home page FAQPage data to the organisation / site data.
Announcement bar. The theme writes nothing: the core prints the bar at the SiteBodyStart point (like other parts the theme cannot remove). The look can be overridden with the .wi-ann, .wi-ann__row--info|success|warning|campaign, .wi-ann__x classes. Dismissal is stored in the visitor's browser; without the script the close button is hidden.
Campaigns — campaigns.wcp. Per card countdown_html (core countdown markup when the end is in the future, otherwise null). $products: packages with a live campaign — showcase card fields + campaign {name, price {old, new, label} | null, ends_at, until} + countdown_html. The countdown script is $blocks['script_html']; it must be printed at the end of the page.