Help Your site's set-up

Twig blocks and custom CSS

Pasting in Twig blocks, styling your site with your own CSS on labels that never change, and custom JavaScript.

Twig blocks

In the page editor, add a Twig block (under Pictures, words and video). Pick where it runs: a Custom Twig block, a Competition grid card (written once, shown for each competition, each card linking to it) or a Slider. Paste your template into Twig, any CSS into CSS, and add the variables it uses (Text, Number, Products, Winners, Instant Winners and the rest).

  • The tags are if, for and set (plus apply and verbatim); the usual filters work, prices come with the pound sign, and dates have their _raw and _seconds forms.
  • The live helpers work as written: raffleCountdown, raffleProgress, raffleQuickAdd, raffleBasket and Splide sliders.
  • A block that does not work is refused when you save it, with the line that is wrong, so a broken block never shows on your site.
  • Quick add only adds tickets when a customer presses its button themselves.

Custom CSS

Open Custom CSS. Aim your CSS at the labels listed there, for example `[data-part="card.sold-bar"]`, and use the colour names such as `var(--brand-primary)`. The labels never change, so an update never breaks your styling. The preview shows your draft on your own site before you save; Undo the last change steps back one save at a time.

  • Your CSS runs on every page, checkout and sign-in included.
  • Pictures in it must be on your own site: upload them in Media and use their /uploads/ address. Pictures from other sites are left out, and saving tells you so.
  • The `<` sign is taken out, because it could end the style sheet. In a media query write `max-width: 600px` rather than `width < 600px`.

Custom JavaScript

Scripts in the header and footer code, the order complete code and the Custom HTML block run only once PrizeCore has switched custom JavaScript on for your site, with the script addresses agreed then. Ask us. They never run on the checkout, payment, sign-in, password, account or prize pages.

Take care. If custom code ever breaks your site, PrizeCore can switch all of it off at once. Nothing is deleted; a red line on every admin page tells you, and it all comes back when it is switched on again.

Every site’s admin has this guide built in, with a help link on each page. All help articles.