Help Site

The AI guide for Edit as code

Everything an AI needs to write a block for your site: paste it into ChatGPT, Claude or any other, say what you want, and paste the answer into the block.

Any block can be opened as code (see the page builder, "Editing a block as code"). You do not have to write the code yourself: this guide tells an AI exactly what this site runs, the values it has, how the live bits work, the CSS rules and your own brand colours, with worked examples, so the block it writes works first time.

  1. Press Copy the whole guide below (or Guide + this block in the block's code box, which adds that block's own settings and code to the end).
  2. Paste it into your AI, write what you want on the last line of the prompt at the top, and send it.
  3. Paste the Twig it answers with into the block's Twig box and the CSS into the CSS box, then press Save.
  4. If "Line N: ..." shows under the box, paste that line back to the AI and ask it to fix it.

Tip. The guide is made from the site's own code every time it opens, so it is always the current list of values and helpers, with your colours as they are set now.

Inside your admin, this part is written for your own site, with its own colours and settings.

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