Under the hood, Bolt uses the Doctrine ORM to abstract database storage. This means that a Record in, for example, the Pages ContentType will behave as a single Entity in Bolt, but in the database, its data is persisted in a few different tables.Sql Database Mysql Doctrine
If you wish to output the total number of Records in a given Contenttype, you might want to do this:Twig Templating
Define more SEO-friendly and pretty URLs that do not contain the Content Type of your record. For example
/about-us instead of
/page/about-us, but beware: if two records of a different Content Type have the same slug, you'll never know for sure which one will be visible on the frontend. For instance, if there is
/entry/about-us, then there's no way to objectively guarantee which one of the two items will show up on the shortened
If you're migrating a database from MySQL 5.6 to 5.7, you might bump into issues with the JSON encoding of certain fields. This probably happens because only in MySQL 5.7, JSON columns are properly supported. The improved support for native JSON makes it more strict, which can cause errors after bumping the database version or after exporting and subsequently importing it.Database Json Mysql Doctrine Symfony
The OpenGraph Protocol (or "OG" for short) allows other websites to gather relevant information and preview images from your site in order to display them correctly in the context of sites like Twitter, Facebook, or other social media websites.Facebook Twitter Seo Meta Og Og-tags Search
Often times you need to validate phone numbers in a particular format that should be used across the website. Rather tha requiring you to use a certain phone number format, Bolt allows you to define your own validation rules for field values. In this example, I'll show you how to require editors to input the desired phone number format.Fields Validation Regex Phone Telephone
It happens very often that people are looking for help on some topic, and they find it's hard to get a good answer. In this article, i'll share a few tips that make it easier to pose a good question, that'll get you results quicker.News Help Support
Often times people are looking to create a simple search on the listing page (for example, to search blog posts, news, events, etc.). In this article, I'll share how to do that easy-peasy in twig itself.Search ContentTypes
Even though the entire world is in chaos at the moment, we’re nearing the release of a stable Bolt 4.0 release. There’s still some work to be done: More documentation needs to be written, and there's undoubtedly a few bugs to be fixed, but we’re getting there.
The installation part of the Bolt documentation talks about how “developing on a live webserver” is not best practice, and just tells you to use a local environment instead. The thing is, “just” is a terrible word to use in documentation. It makes a ton of assumptions about people’s skill level, background, preferred working style and more. So, instead of telling people to “just use a local environment”, I’m going to write a series of articles about how to set up a local environment on your workstation to get you kickstarted on developing websites with Bolt.
In these articles I’ll attempt to find a balance between doing things to makeshift and going overboard on procedure. This means that we’ll get things up and running on the command line, using freely available tools.
Here are the topics I’m going to cover:
- Getting up and running with the Command Line / Terminal
- Making sure we have a proper version of PHP and a database on our system
- Installing some essential tools like Composer and the Symfony CLI
- Running a webserver
- Setting up your Bolt Project
- Configuring your editor / IDE
- Getting started with Git
This seems like a lot of steps before we get to our initial goal of having a working environment for Bolt. But, I can absolutely guarantee you that the time invested in the steps that precede it will change your way of working forever.
Initially, I’m going to focus on MacOS, because that’s simply what I’m most familiar with. If there’s interest, I’ll make a version that’s suitable for Windows too.Local Development Environment