§5.17
Gift wheel
- Phase 12.2
- theme 1.18.0
giftwheel.wcp (new, optional; public region). Address site_url('wheel') (/hediye-carki). While the wheel is off the page returns 404. Without the file the core view is drawn.
| Variable | Content |
|---|---|
$heading, $lead |
Page title and description |
$open |
Whether the wheel is open and ready (campaign dates, odds total 100%). When closed wheel_html carries the "closed" message |
$guest |
Whether the viewer is a visitor |
$rules |
"How it works" points (frequency, dates, coupon and gift package rules) |
$state_text |
For a signed-in client: remaining spin / next spin / block text (the drawn version is in wheel_html too) |
$prizes |
Prizes won: name, date, details (amount, coupon code, end date, points), type, coupon_state (active / used / expired / null), order_url (for a gift package, when the coupon is usable) |
$blocks |
wheel_html (wheel, visitor login layer, spin form, result region), prizes_html (core prize list), script_html (spin script) |
Rules: the wheel drawing, form and script are in the core; the theme places them and produces no slices, odds or results. Visitors never receive slice names; the theme must not write them either. The result is decided on the server; the script only spins the wheel for display (no spin with prefers-reduced-motion). script_html is only set for a signed-in client. The wheel block's styling arrives with .wi-wheel* classes; the theme can override colours and layout. The default theme marks prizes with data-wheel-prize.