Bolt 3 will come with more improvements to make your lives as front-end developers easier.

We've found that people often bump into an issue, where they'd like to have a straightforward (or even "officially approved") way to deal with small blocks of content. A disclaimer in a footer, a business address, or a quick note on the 404 not found-page. Stuff like that. We often pointed people to the page in the documentation that shows how to set this up, and people usually said "Yes, that's exactly what I needed".

To make this easier for new users, we've added a 'blocks' contenttype, that's available immediately when setting up a new Bolt installation. In fact, if you use the "Lorem Ipsum" dummy text generator, it will get prefilled with some default titles and slugs, which are automatically picked up by the new Base-2016 theme.

For example, take this partial screenshot of a freshly set up Bolt install:

It shows a small 'About Us' blurb in the sidebar, together with a "Read More"-link, as well as a "Edit"-link, to quickly edit the text. The latter is obviously only available for logged in editors.

We've added a few more improvements to make working with Bolt themes easier, as well as lower the 'threshold' for beginners. For example, we've added a {{ link() }} tag, that allows the editor more freedom, when entering links. In the backend, it could look like this:

This allows the editor to input 'entry/so-long', or, and it'll work as expected.

Finally, the default record.twig was a source of confusion for a lot of people. It was a great way to simply output all fields on a page, without needing to know exactly what was defined in the content-type. However, the downside of this was that it came with a huge chunk of complicated Twig tags. See this example: record.twig. Adding to that, the fact that Bolt 3 comes with a new Storage Layer that allows for 'Repeating fields', this made us realize we needed a better way to handle outputting all available fields for a contenttype, without the need to manually specify them in the theme. For example, the fields()-tag in the snippet below will render a default page, with all the defined fields, regardless of what these fields exactly are:

{% extends 'partials/_master.twig' %}
{% block main %}

{{ record.title }}

{{ fields() }} {% include 'partials/_recordfooter.twig' with { 'record': record } %} {% endblock main %}

Of course, you can specify them all by hand, but you don't have to. By default we've created a 'sane' output for all field types, but you can override them in your theme, if you wish.

comments powered by Disqus