-1

I was just going through the documentation of boltCMS HERE, and came across the following explanation:

In a page that’s used for a single record, (like entry.twig or record.twig), the variable {{ record }} will always be available, regardless of the contenttype. To make the templates more ‘semantic’, there’s also a variable with the singular name of the contenttype available, like {{ page }}, {{ entry }} or {{ event }}.

I am not quite understanding the below statement 100%:

In a page that’s used for a single record.

What does the above statement really mean ?

Alexander Solonik
  • 9,838
  • 18
  • 76
  • 174

1 Answers1

2

In Bolt there's generally two types of pages, listing pages and record pages.

A listing page will show an overview of the items in that contenttype, so /entries may show the 10 most recent blog entries with a pager at the bottom.

On a listing page, the variable available in twig is called records a listing page will loop over all records and show a summary

{% for record in records %}
    {{ record.title }}
    ......etc.....
{% endfor %}

On a single record page, eg after you click through to read the full entry /entry/an-example-entry then this will be rendered via a record page and a single item (rather than an interable array of items) will be available, you access that using record for example the title: {{ record.title }}

Hopefully that makes a bit more sense.

Ross Riley
  • 826
  • 5
  • 8