FleekSiteFLEEKSITE
On this section
Site features

Bits.

A bit is a small named value stored on your site. Bits hold the pieces of copy and configuration you want to set once and reuse across templates: a tagline, a phone number, a promotional line, the message a 404 page shows. Your templates read them; the platform keeps them.

A bit has three fields you work with: a name, a value, and a category. The category groups related bits together, so general might hold a tagline and a strapline while contact holds a phone number and an email address. A bit saved with no category is filed under general.

What a bit holds

Each bit belongs to exactly one site and one category. The value is free text, so a bit can be a single word, a sentence, or a fragment of markup you want to drop into a page. The name is how you address it, and the category is how it is grouped for reading.

FieldWhat it is
nameThe identifier you read the bit by, for example tagline or 404_msg.
valueThe stored text. Read as is; the engine does not process it further.
categoryThe group the bit sits in. Empty categories become general.

Reading a bit

The render context exposes your bits in two shapes. The first, bits, is a map keyed by category then name, of the form { category: { name: value } }. Reach a single value by its category and name:

 class="tagline">{{ bits.general.tagline }}>
 href="tel:{{ bits.contact.phone }}">{{ bits.contact.phone }}>

The second, bit_list, is a map of the same categories to arrays, of the form { category: [ { name, value, category } ] }. Use it when you want to loop every bit in a category rather than name one:

>
  {% for item in bit_list.faq %}
    >{{ item.name }}>
    >{{ item.value }}>
  {% endfor %}
>

Reading a bit that does not exist yields an empty string, the same as any other undefined value in the engine, so a missing bit leaves a gap rather than an error. Both bits and bit_list are part of the render context.

The bit tag

The {% bit name %} tag prints a bit value without you naming its category. It walks every category on the site and prints the value of the first bit whose name matches. The argument is the literal name, bare or quoted, not a context variable, so {% bit tagline %} and {% bit "tagline" %} resolve to the same bit. It is the tidy way to reach a bit whose name is not a plain identifier, such as 404_msg.

{% bit tagline %}
{% bit "404_msg" %}

The {% bit name %} tag prints the value only in Standard mode. In Compat it renders nothing, matching the older engine, which had no such tag. On a compat site, read bits through the bits map instead. See Render modes.

Querying bits

When you need more than a direct lookup, query bits as a collection. The {% collection bits, items %} tag reads them with the same filters, ordering and paging as any other source, and you can narrow to a category. Each entry carries name, value and category along with the record's other fields.

{% collection bits, items, category: 'faq', order: id asc %}

{% for item in items %}
  >
    >{{ item.name }}>
    >{{ item.value }}>
  >
{% endfor %}

See The collection tag and Data sources for the full query vocabulary.

When to use bits

Bits earn their place wherever a value is small, named and reused:

  • Site-wide configuration. Contact details, social links, opening hours: set once, read from every template.
  • Reusable snippets. A promotional line, a notice, a strapline you want to drop into more than one page without repeating it.
  • Feature copy. Headings, button labels and short blurbs that someone should be able to edit without opening a template.