<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Bolt CMS - Medium]]></title>
        <description><![CDATA[Sophisticated, Lightweight and Simple CMS written in PHP - Medium]]></description>
        <link>https://medium.com/bolt-cms?source=rss----5901e0fe2a8a---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Bolt CMS - Medium</title>
            <link>https://medium.com/bolt-cms?source=rss----5901e0fe2a8a---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 01:35:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/bolt-cms" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to build a personal blog with Bolt CMS in under 30 minutes…]]></title>
            <link>https://medium.com/bolt-cms/how-to-build-a-personal-blog-with-bolt-cms-in-under-30-minutes-84185c4dc925?source=rss----5901e0fe2a8a---4</link>
            <guid isPermaLink="false">https://medium.com/p/84185c4dc925</guid>
            <category><![CDATA[website]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[symfony]]></category>
            <dc:creator><![CDATA[Ivo Valchev]]></dc:creator>
            <pubDate>Fri, 04 Jun 2021 14:07:00 GMT</pubDate>
            <atom:updated>2021-06-04T14:07:00.573Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you not heard of Bolt CMS before? Let me fill you in on the big picture in under 30 seconds: Bolt CMS is the content management system built for all three user groups: you, the implementor, the content editors, and the site end users. At Bolt HQ, we are a bunch of pragmatic web developers who make a living out of building websites for clients. We know a thing or two about CMS features that content editors are looking for, so with the help of our open source community, we baked them into Bolt CMS. Bolt gives you the Lego blocks, it’s up to you to decide if you are building a megapolis, or a quiet little house on the side of the road. It’s <a href="https://boltcms.io/no-costs">completely free</a> and <a href="https://github.com/bolt/core">open source</a>.</p><blockquote>Today, we’re building your personal blog in under 30 minutes!</blockquote><p>In fact, there’s surprisingly few things we need to build a personal blog website:</p><ul><li>A computer with PHP &amp; composer package manager</li><li>A file editor or IDE</li><li>And a tiny bit of imagination 😇</li></ul><h3>1. Set up a new Bolt project</h3><p>Before diving into our new Bolt project, make sure to have <a href="https://www.php.net/manual/en/install.php">PHP</a> and <a href="https://getcomposer.org/">composer</a> installed on your machine. These are the foundations of any modern PHP project, after all.</p><p>To create a new Bolt project, open up a terminal (Windows: command line), and type:</p><pre>composer create-project bolt/project my-blog</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kz0JaJtYv43kdzV2iX0odg.png" /><figcaption>Type in the command to create a new project and hit Enter</figcaption></figure><p>This will create a new Bolt project in the my-blog folder, you’ll appear like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ymq4TmeVYUvSbvJGF4aEWw.png" /><figcaption>Example message on successful installation. Note, by the time you run this, there will be a newer version with even more cool features! 🐛</figcaption></figure><p>So far, so good!</p><p>To finish up the installation, change directory to the new folder and run the Bolt installation script like so:</p><pre>cd my-blog/ &amp;&amp; php bin/console bolt:setup</pre><p>You’ll be asked to create an admin account. After this, it’ll ask you to add dummy content (fixtures): choose yes.</p><h3>2. Run the new website in the browser</h3><p>You may not know this yet, but there’s already a working Bolt website waiting for you!</p><p>To start a development server for your website, run the following:</p><pre>php bin/console server:start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1QVGrGiVAm-XnFR0LhTkRQ.png" /><figcaption>Starting a development server of your website</figcaption></figure><p>As soon as you type http://127.0.0.1:8000 (or localhost:8000`), you’ll see the new website in action. Since we asked Bolt during setup to create dummy content for us, it will already have lorem ipsum pages and text:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*crvTXlHwRjo24B7_blxrkw.png" /></figure><h3>3. Set up a simple blog</h3><p>Like many content management systems, content in Bolt is managed in Content Types. A Content Type defines the structure of your website content, for instance News, Pages, Blog Posts, Testimonials and Sections are all examples of a ContentType. What makes them so cool is how ridiculously easy it is to define them: all ContentTypes are defined in YAML format in the config/bolt/contenttypes.yaml file.</p><p>Open up the my-blog/config/bolt/contenttypes.yaml file in your favourite text editor or IDE. The file has a lot of comments explaining how it all works, but for now, you can remove everything and replace it with this:</p><pre><em># This file defines the content types on the website. See the documentation for<br># details: https://docs.bolt.cm/contenttypes/intro<br><br></em>blogposts:<br>    name: Blog Posts<br>    singular_name: Blog Post<br>    fields:<br>        title:<br>            type: text<br>        content:<br>            type: article</pre><pre>blocks:<br>    name: Blocks<br>    singular_name: Block<br>    fields:<br>        title:<br>            type: text<br>            class: large<br>            group: &quot;Block&quot;<br>            label: De Titel<br>        slug:<br>            type: slug<br>            uses: [ title ]<br>        image:<br>            type: image<br>        content:<br>            type: html<br>            height: 150px<br>    viewless: true<br>    searchable: false<br>    icon_many: &quot;fa:cubes&quot;<br>    icon_one: &quot;fa:cube&quot;<br>    order: title</pre><p>This defines a new Content Type for Blog Posts, which has two fields: a title and a body content. And another Content Type for blocks, which will be elements across the site that are not standalone pages, but still have content that can be edited.</p><p>Save the file and head to <a href="http://localhost:8000/bolt">http://localhost:8000/bolt</a> . Remember that admin account that you set up? Use it to login to the Bolt Editor for the first time! After logging in, you’ll see the new Blog Posts on the left of the screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N0T9dZKMD5Ov6pJ9UrmGWg.png" /><figcaption>The Bolt Editor showing the Blog Posts and Blocks content types on the left</figcaption></figure><p>Hover over Blog Posts and click “New” to add some blog article!</p><h3>4. Set up the theme of the new website</h3><p>So far, we saw and used Bolt’s default theme. Time to shake things up a bit, I’ll use the Leaf theme for Bolt, developed by Bolt’s creator Bob. You can also look up other themes on the <a href="https://extensions.boltcms.io/packages?packagist_type=bolt-theme">Bolt extensions website</a>.</p><p>To install the theme, go back to the terminal and run:</p><pre>composer require bobdenotter/bolt-leaf-theme</pre><p>Now, let’s copy the theme to your project:</p><pre>php bin/console bolt:copy-themes</pre><p>One last step is to tell Bolt to use the new theme, open the my-blog/config/bolt/config.yaml file and replace theme: base-2021 with bolt-leaf-theme . In the same files, replace:</p><pre>homepage: homepage<br>homepage_template: index.twig</pre><p>With:</p><pre>homepage: blog-posts<br>homepage_template: listing.twig</pre><p>Voilà!</p><h3>Your personal blog is now complete</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s9yMB5a7oaG_7PngGTKAjQ.png" /><figcaption>Your new blog built with Bolt CMS</figcaption></figure><p>In just under 30 minutes, we built a personal blog with Bolt CMS. As you add more blog posts, you’ll find that all of these things are already handled by Bolt:</p><ul><li>Detail blog pages with freeform content, images and videos</li><li>A list of all blog posts, with excerpts and meta data like the author and time of publication</li><li>Pagination</li><li>Multilingual (as soon as you are ready to add a new language)</li></ul><h3>The next steps?</h3><p>If you’re looking to expand your new website, here are useful resources to help you get started:</p><ul><li><a href="https://boltcms.io/">boltcms.io</a> — the main Bolt CMS website with all links and info you’ll need</li><li><a href="https://docs.bolt.cm/">docs.bolt.cm</a> — documentation</li><li><a href="https://extensions.boltcms.io/">extensions.boltcms.io</a> — list of available Bolt extensions</li><li><a href="http://bolt.tips/">bolt.tips</a> — tips &amp; tricks on various Bolt subjects</li><li><a href="https://boltcms.io/community">Slack &amp; twitter links</a> — get in touch with the community to get your questions answered, and learn from the best</li></ul><p>Happy building! 🛠⚙️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84185c4dc925" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bolt-cms/how-to-build-a-personal-blog-with-bolt-cms-in-under-30-minutes-84185c4dc925">How to build a personal blog with Bolt CMS in under 30 minutes…</a> was originally published in <a href="https://medium.com/bolt-cms">Bolt CMS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bolt 4: the awesome CMS]]></title>
            <link>https://medium.com/bolt-cms/bolt-4-the-awesome-cms-225bbb9526b9?source=rss----5901e0fe2a8a---4</link>
            <guid isPermaLink="false">https://medium.com/p/225bbb9526b9</guid>
            <category><![CDATA[content-management]]></category>
            <category><![CDATA[symfony]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[content-management-system]]></category>
            <dc:creator><![CDATA[Ivo Valchev]]></dc:creator>
            <pubDate>Thu, 24 Sep 2020 13:47:07 GMT</pubDate>
            <atom:updated>2020-09-25T17:52:31.954Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*7s91NZ2e_VcD4lZEeSXCkQ.png" /></figure><p>Bolt CMS has been officially released this week, bringing fruit to a two-year-long journey of extensive development. During that time, we asked questions, we learnt from previous successes and mistakes, and we rolled up our sleeves and wrote code. The result? A content management system that’s easy for web designers &amp; developers, yet simple and powerful for content editors.</p><blockquote>Bolt’s promise to web developers: make CMS configuration easy-peasy!</blockquote><h3>Here’s 10 reasons why CMS configuration is so easy</h3><ol><li><a href="#8304">Powerful ContentTypes</a></li><li><a href="#14ff">Built-in internationalisation</a></li><li><a href="#e3b4">Best rich content editors. For free</a></li><li><a href="#a03c">20 field types (+ dynamic collections of fields)</a></li><li><a href="#65ec">Twig templates</a></li><li><a href="#899a">Out-of-the-box API: REST &amp; GraphQL</a></li><li><a href="#8fb1">Extensions: get your hands dirty and customise Bolt further</a></li><li><a href="#664b">Fixtures (dummy content) to help you develop easier</a></li><li><a href="#47a0">Easy deployment</a></li><li><a href="#5b09">Friendly and supportive community (good morning to you ☕)</a></li></ol><h3>1. Powerful ContentTypes</h3><p>Bolt structures all content in ContentTypes: a content type defines the structure of your website content, for instance News, Pages, Blog Posts, Testimonials and Sections are all examples of a ContentType.</p><p>What makes them so cool is how ridiculously easy it is to define them: all Content Types are defined in yaml format in the contenttypes.yaml file. Here’s an example:</p><pre>pages:<br>    name: Pages<br>    singular_name: Page<br>    title_format: [ heading, subheading ]<br>    fields:<br>        heading:<br>            type: text<br>            class: large<br>            group: content<br>            localize: true<br>        subheading:<br>            type: text<br>            class: large<br>            localize: true<br>        slug:<br>            type: slug<br>            uses: [ heading ]<br>            localize: true<br>        photo:<br>            type: image<br>            label: &quot;Image of workplace&quot;<br>        content:<br>            type: html<br>            allow_twig: true<br>            localize: true<br>    locales: [&#39;en&#39;, &#39;nl&#39;, &#39;ja&#39;, &#39;nb&#39;]</pre><p>By adding the pages content type to your configuration, Bolt will</p><ol><li>Include the content type to the Editor (admin area) of the website</li><li>Allow editors to create, edit and delete pages</li><li>Display all published pages on your website</li></ol><p>Take a look yourself:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e9gLdsKK-0b-rntuTvGKPw.png" /><figcaption>Page will be displayed at www.example.org/page/this-is-my-first-page-in-bolt-cms</figcaption></figure><h3>2. Built-in internationalisation 🌐 🇩🇪 🇮🇸 🇧🇷</h3><p>Did you notice the following configuration from the example above:</p><pre>locales: [&#39;en&#39;, &#39;nl&#39;, &#39;ja&#39;, &#39;nb&#39;]</pre><p>By adding this one line to your content type, Bolt will make your pages translatable. The even cooler thing? You have field-level control over what is translated and what is not. For example, the page heading can be translated, whilst the photo will stay the same across languages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Usm05Q3v3koK9UUPd_040w.png" /></figure><p>Want to see which fields are translated across languages and which not? No problem. Bolt’s got you covered.</p><h3>3. Best rich content editors. For free</h3><p>Redactor &amp; Article: the _best_ rich text editors, fully licensed for use in Bolt itself. For free.<br>Why? Because we believe editing content should be <strong>easy</strong>. You, as a content editor, should be provided with as much freedom as possible to adapt your pages yourself. No technical knowledge required. Have a campaign? Drag, embed and play with the content. Add content blocks you need. Life can be so simple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYIQiuRHbAVS-Fjtav0WTA.png" /><figcaption>Using Imperavi’s fantastic Article and Redactor. <strong>Free with Bolt.</strong></figcaption></figure><h3>4. 20 field types (+ dynamic collections of fields)</h3><p>By default, the CMS comes with all the standard field types you’d expect, e.g.: text, date, file, image, markdown, select and others.</p><p>In addition, Bolt supports natively the following field types:</p><ol><li><strong>Filelist</strong> &amp; <strong>Imagelist</strong>: easy way to allow editors to attach multiple files and images.</li><li><strong>Collections</strong>: a grouping of fields. Adding dynamic number of fields is as easy as pressing a button in the Editor. For example, we can define a collection of members on our Team page and allow content editors to add multiple people with their name, image and position. Editors can add, delete, and re-order collection items with a click of a button!</li><li><strong>Templateselect</strong>: allow editors to select the Twig template that will be used to display the page. What is a Twig template? See right below!</li></ol><h3>5. Twig templates</h3><p>The flexible, fast and secure templating language Twig is the <em>de-facto standard</em> across the Symfony community and beyond. At the core of it is <strong>simplicity</strong> and <strong>security</strong>.</p><p>Take a look how easy it is to generate the HTML for your pages:</p><pre>{% extends &#39;partials/_master.twig&#39; %}<br><br>{% block main %}<br>    &lt;div&gt;<br>        &lt;h1&gt;{{ record.heading }}&lt;/h1&gt;<br>        &lt;h2&gt;{{ record.subheading }}&lt;/h2&gt;<br><br>        {{ showimage(record.photo) }}<br><br>        {{ record.content }}<br>    &lt;/div&gt;<br>{% endblock %}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e7HG9X8oh1zh_45H2c9nOg.jpeg" /></figure><h3>6. Out-of-the-box API: REST &amp; GraphQL</h3><p>Without any additional configuration, Bolt provides a RESTful and GraphQL API, allowing you to use the CMS in <em>headless</em> mode, alongside a static site generator, or simply to feed data into whatever other platform that wants to listen to it.</p><h3>7. Extensions: get your hands dirty and customise Bolt further</h3><p>Getting a little more technical here, but… the beauty of Bolt being a Composer package is how easy it is to extend it. There’s literally no limits to what functionality you can add to Bolt, or on top of Bolt, as an extension.</p><p>Write your code and easily create a Bolt extension from it. Bolt automatically makes your extension autoloaded and autowired, and you’ll have all of Symfony’s services available. You can even have your extension depend on other Composer packages to pull them into your project.</p><p>To read more about extending Bolt, read the <a href="https://docs.bolt.cm/4.0/extensions/introduction">documentation</a> and check the <a href="https://extensions.boltcms.io/">extensions that already exist</a> to get started.</p><h3>8. Fixtures (dummy content) to help you develop easier</h3><p>Loading test content during development, or when deploying to showcase your work, is tiresome. But it needn’t be. Once you have your content types set up, it is as easy as running this one line of code to prepopulate your CMS with dummy data:</p><pre>bin/console doctrine:fixtures:load -n</pre><h3>9. Easy deployment 🚂🚃🚃</h3><p>At its core, Bolt is a Composer package. In addition, all of Bolt’s (and Symfony’s) configuration is stored in its YAML configuration files.</p><p>This means Bolt is easy to deploy in different environments. You can most likely keep using your preferred deployment and release strategy when you start working with Bolt. Whether you prefer using a tool like Deployer, a small bash script to git pull, Composer install or old-fashioned FTP. Bolt doesn’t enforce a specific workflow, but adapts to your preferences.</p><h3>10. Friendly and supportive community (good morning to you ☕)</h3><p>Best of all is our open source community: <a href="https://boltcms.slack.com/">our Slack community</a> has over 1,600 members doing the same thing as you do: building awesome websites. The community is a great place to get to know like-minded people as well as get some help when needed. Head over to the community now and say hi :-)</p><h3>Ready to start building?</h3><p>If you’re ready to try this out, go over to the <a href="https://boltcms.io/">Bolt CMS website</a> or start your first project by running:</p><pre>composer create-project bolt/project myfirstproject</pre><p>Good luck building! 🛠⚙️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=225bbb9526b9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bolt-cms/bolt-4-the-awesome-cms-225bbb9526b9">Bolt 4: the awesome CMS</a> was originally published in <a href="https://medium.com/bolt-cms">Bolt CMS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Improve the Flexibility of Widgets in Bolt 3]]></title>
            <link>https://medium.com/bolt-cms/how-to-improve-the-flexibility-of-widgets-in-bolt-3-e5e3d82ece76?source=rss----5901e0fe2a8a---4</link>
            <guid isPermaLink="false">https://medium.com/p/e5e3d82ece76</guid>
            <category><![CDATA[themes]]></category>
            <category><![CDATA[boltcm]]></category>
            <category><![CDATA[twig]]></category>
            <dc:creator><![CDATA[Phillipp]]></dc:creator>
            <pubDate>Mon, 20 Jun 2016 08:50:58 GMT</pubDate>
            <atom:updated>2016-06-20T10:21:31.399Z</atom:updated>
            <content:encoded><![CDATA[<p>Bolt 3 comes with a new feature called “Widgets”. With them, you can easily extend the frontend and backend of a Bolt application. The concept is not new but it wasn’t a thing in Bolt before.</p><h4>How They Work</h4><p>It’s pretty simple. There are different named widget locations. Then a Bolt extension can push HTML into these locations to show some sort of content. While there are widget locations all over the Bolt backend, it’s up to the theme developer to add them to the frontend.</p><h4>The Problem</h4><p>The backend has a known HTML structure, but the frontend don’t. That’s where it gets tricky.</p><p>Meaningful locations for widgets in the frontend are the sidebar, the footer and maybe on top and below the content area. The sidebar and the footer are very likely to have some sort of <em>wrapper</em> around each item that handles some spacing, background, etc.</p><p><strong>But the extension cannot know about the need for such a wrapper.</strong></p><p>Let me show you an example:</p><p>The template of a sidebar with two widget locations could look like the following.</p><pre>&lt;div class=&quot;sidebar&quot;&gt;<br>  {{ widgets(&#39;aside_top&#39;) }}<br>  &lt;div class=&quot;sidebar_item&quot;&gt;some content ...&lt;/div&gt;<br>  &lt;div class=&quot;sidebar_item&quot;&gt;some content ...&lt;/div&gt;<br>  &lt;div class=&quot;sidebar_item&quot;&gt;some content ...&lt;/div&gt;<br>  {{ widgets(&#39;aside_bottom&#39;) }}<br>&lt;/div&gt;</pre><p>And now we have an extension that wants to display the following list in the sidebar.</p><pre>&lt;ul&gt;<br>  &lt;li&gt;Very&lt;/li&gt;<br>  &lt;li&gt;Useful&lt;/li&gt;<br>  &lt;li&gt;List&lt;/li&gt;<br>&lt;/ul&gt;</pre><p>But what’s with the wrapper? We will end with a sidebar with broken spacing and other missing styles that are applied via the wrapper.</p><h4>The Solution</h4><blockquote><strong>Update:</strong> Scroll to the end to see the built in way to handle it all via the theme.</blockquote><p>While we can’t expect the extension to know about the wrapper, we could tell it about the wrapper if both, the extension and the theme, implemented the technique I will describe below.</p><p>What is needed:</p><ul><li>The extension has to accept a wrapper template</li><li>The theme has to provide a wrapper template</li></ul><p>The idea is simple. We don’t just tell the extension about the widget location to use, we also tell it if there is a wrapper template to use.</p><p>An extension config could look like this:</p><pre>widget:<br>  location: aside_top<br>  wrapper_template: widget_aside_wrapper.twig</pre><p>The template that will be displayed by the extension could look like this:</p><pre>{% extends wrapper %}<br>{% block content %}<br>  &lt;ul&gt;<br>    &lt;li&gt;1&lt;/li&gt;<br>    &lt;li&gt;2&lt;/li&gt;<br>    &lt;li&gt;3&lt;/li&gt;<br>    &lt;li&gt;4&lt;/li&gt;<br>    &lt;li&gt;5&lt;/li&gt;<br>  &lt;/ul&gt;<br>{% endblock content %}</pre><p>The important part here is that it extends a template that will be passed via the <em>wrapper</em> variable.</p><p>The wrapper template must include the <em>content</em> block so our content will be inserted when we extend the template.</p><pre>&lt;div class=&quot;sidebar_item&quot;&gt;<br>  {% block content %}{% endblock content %}<br>&lt;/div&gt;</pre><p>To get this wrapper, I wrote a small and helpful function:</p><pre>protected function getWidgetWrapper($template)<br>{<br>  $wrapper = $this-&gt;getContainer()[&#39;twig&#39;]<br>               -&gt;createTemplate(<br>                 &quot;{% block content %}{% endblock content %}&quot;<br>               );</pre><pre>  if($template){<br>    $wrapper = $this-&gt;getContainer()[&#39;twig&#39;]<br>                 -&gt;loadTemplate($template);<br>  }</pre><pre>  return $wrapper;<br>}</pre><p>It receives the template name defined in the extension config and returns a twig instance so you can pass it to your own template. If the user didn’t define a wrapper template, it will create an empty one that we can extend.</p><p>And that’s how we use it in our widget callback function:</p><pre>public function callbackWidget()<br>{<br>  $wrapper = $this-&gt;getWidgetWrapper(<br>               $this-&gt;getConfig()[&#39;widget&#39;][&#39;wrapper_template&#39;]<br>             );</pre><pre>  return $this-&gt;renderTemplate(<br>                  &#39;widget.twig&#39;, <br>                  [&#39;wrapper&#39; =&gt; $wrapper]<br>                );<br>}</pre><p>This approach work really well, even if it’s only a workaround for a problem that nobody thought about when the widget functionality was implemented.</p><p>Maybe Bolt will implement a solution for wrappers in a future version, but until that, you should definitely consider this approach for your next extension.</p><p>Tip: As you can see above, you can create a twig instance from a string. That means we don’t even need themes that provide a wrapper template. The user could just define the wrapper template as string in the extension config.</p><h4>Or Use the F#!cking Built in Functionality</h4><p>I was about to create an RFC to suggest that we can pass a wrapper template via the <em>widgets()</em> function so the theme handles everything. Of course, the functionality is already there and works a bit different though.</p><p>So, in our theme, we can do the following:</p><pre>{{ widgets(&#39;aside_top&#39;, &#39;frontend&#39;, &#39;sidebar_widget_wrapper.twig&#39;) }}</pre><p>The provided <em>sidebar_widget_wrapper.twig</em> doesn’t look like the wrapper template from my solution above. Here we have to iterate over the widgets to wrap them. It’s not very difficult though:</p><pre>{% for widget in widgets %}<br>  &lt;div class=&quot;sidebar_item&quot;&gt;<br>   {{ widget.html | raw }}<br>  &lt;/div&gt;<br>{% endfor %}</pre><p>That’s all it needs to use the built in functionality which might also be the better solution in the long run. However, if the used theme doesn’t provide this, my initial idea in combination with a wrapper template defined as string in the config could be a valid fallback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5e3d82ece76" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bolt-cms/how-to-improve-the-flexibility-of-widgets-in-bolt-3-e5e3d82ece76">How to Improve the Flexibility of Widgets in Bolt 3</a> was originally published in <a href="https://medium.com/bolt-cms">Bolt CMS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Bolt Extension Collection] Building a Blog]]></title>
            <link>https://medium.com/bolt-cms/bolt-extension-collection-building-a-blog-4a46ac6b3439?source=rss----5901e0fe2a8a---4</link>
            <guid isPermaLink="false">https://medium.com/p/4a46ac6b3439</guid>
            <category><![CDATA[boltcm]]></category>
            <category><![CDATA[extension-collection]]></category>
            <category><![CDATA[blogging]]></category>
            <dc:creator><![CDATA[Phillipp]]></dc:creator>
            <pubDate>Sat, 28 May 2016 12:01:14 GMT</pubDate>
            <atom:updated>2016-05-28T12:01:14.185Z</atom:updated>
            <content:encoded><![CDATA[<p>If you want to build a blog, Bolt is definitely the right tool for you and here are some useful extensions you should look at.</p><h4><a href="https://extensions.bolt.cm/view/eaf970b8-deca-11e5-bf25-14cdca8e654f">User Profiles</a></h4><p>Let’s you easily extend the default users table with new fields like <em>description</em>, <em>avatar</em> and social media account links.</p><h4><a href="https://extensions.bolt.cm/view/3cda7d7e-09e9-11e5-9120-621e70d6e3eb">Bolt SEO</a></h4><p>Let’s you define custom title, description and other meta tags.</p><h4><a href="https://extensions.bolt.cm/view/09e6e88b-61b4-4b4e-99c6-df27db3c8ac9">Disqus</a></h4><p>Adds the Disqus comments system.</p><h4><a href="https://extensions.bolt.cm/view/e89b81c7-bbd3-4221-82b9-070ba6680c45">Sitemap</a></h4><p>Creates XML sitemaps you can use for Google Webmaster Tools.</p><h4><a href="https://extensions.bolt.cm/view/87e7ff17-31dc-4f8b-bc4a-05159b8293a3">RSS Feed</a></h4><p>Provides a simple RSS feed for your readers.</p><h4><a href="https://extensions.bolt.cm/view/30b130a7-0ebb-11e5-9120-621e70d6e3eb">Monthly and Yearly Archives</a></h4><p>Provides new listing for records grouped by month or year.</p><h4><a href="https://extensions.bolt.cm/view/691bcf6f-02f9-4584-a275-baa210bfbe50">TaxonomyList</a></h4><p>Let’s you add tag clouds or category lists.</p><h4><a href="https://extensions.bolt.cm/view/45073af0-8585-4d5b-b978-fd6405858e0e">Related Content by Tags</a></h4><p>Uses the tags of a record to determine other related records.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a46ac6b3439" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bolt-cms/bolt-extension-collection-building-a-blog-4a46ac6b3439">[Bolt Extension Collection] Building a Blog</a> was originally published in <a href="https://medium.com/bolt-cms">Bolt CMS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Add Support for Specific Extensions to a Bolt Theme]]></title>
            <link>https://medium.com/bolt-cms/add-support-for-specific-extensions-to-a-bolt-theme-226db0a8d6c5?source=rss----5901e0fe2a8a---4</link>
            <guid isPermaLink="false">https://medium.com/p/226db0a8d6c5</guid>
            <category><![CDATA[boltcm]]></category>
            <category><![CDATA[extension]]></category>
            <category><![CDATA[twig]]></category>
            <dc:creator><![CDATA[Phillipp]]></dc:creator>
            <pubDate>Thu, 26 May 2016 09:47:24 GMT</pubDate>
            <atom:updated>2016-05-28T10:30:58.973Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are building a public Bolt theme, it might be helpful to provide support for common extensions like the Disqus and Facebook comments extensions.</p><p>This way, your users just have to install the theme and don’t need to edit any template files at all. 🚀</p><p>The following section won’t cover how to implement extensions but how to check if they are installed so your theme doesn’t break badly. 💥</p><h4>Check If an Extension Is Installed in Bolt 2</h4><pre>{% <strong>if </strong>Disqus <strong>is </strong>defined %}<br>    ... doing the implementation<br>{% <strong>endif </strong>%}</pre><h4>Check if an Extension is Installed in Bolt 3</h4><pre>{% <strong>if </strong>app.extensions.get(&#39;bolt/disqus&#39;) %}<br>    ... doing the implementation<br>{% <strong>endif </strong>%}</pre><h4>Show Which Extensions Are Supported</h4><p>Supporting third party extensions is one thing, showing which ones is another.</p><p>There is a very simple way to mark specific extensions as supported. Simply add the following section to your <em>composer.json</em> in your extension:</p><pre>“suggest”: {<br>    “bolt/disqus”: “Add Disqus comments to your entries.”<br>},</pre><p>Now they are not only defined in a centralized place which is good for parsing the information. They are also shown on the theme detail page in the Bolt Extension Store.</p><p>And of course, you can also note them in your README, which I highly recommend too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=226db0a8d6c5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bolt-cms/add-support-for-specific-extensions-to-a-bolt-theme-226db0a8d6c5">Add Support for Specific Extensions to a Bolt Theme</a> was originally published in <a href="https://medium.com/bolt-cms">Bolt CMS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One-Pager Made Easy with Bolt]]></title>
            <link>https://medium.com/bolt-cms/one-pager-made-easy-with-bolt-1055322a974e?source=rss----5901e0fe2a8a---4</link>
            <guid isPermaLink="false">https://medium.com/p/1055322a974e</guid>
            <category><![CDATA[one-pager]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[boltcm]]></category>
            <dc:creator><![CDATA[Phillipp]]></dc:creator>
            <pubDate>Fri, 04 Mar 2016 08:16:19 GMT</pubDate>
            <atom:updated>2016-03-04T08:16:19.514Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xShpbadin05tkcNwjY0-xw.png" /></figure><p>One-Page sites are great when you have little content, want to promote something or if SEO is not a priority.</p><p>Personally I am not a big fan of them, but you or your client might be. So let me show you how to build one with Bolt. Don’t worry, it’s actually quite easy and can be done with Bolts core functions.</p><h4>The Technical Concept</h4><p>So what do we need? We need different sections with different layouts.</p><p>For the sections, we’ll create a new <em>Sections</em> contenttype with just a title, slug and a template select field.</p><p>Each section layout will get its own template and template fields. This way we can store exactly the data each section needs, without having thousands of different input fields on our <em>Sections</em> contenttype itself.</p><p>Let’s get started, shall we?</p><p>I’ll assume you already have a Bolt instance running and skip the installation part. If you haven’t, you can find detailed instructions <a href="https://docs.bolt.cm/installation">here</a>.</p><h4>The Sections Contenttype</h4><p>This will be the backbone of our One-Page site. It defines the different sections with their template and data. We will also be able to sort the order of our sections.</p><p>As mentioned above, the sections just need a title, slug and a template select field. The final contenttype could look like this:</p><pre>sections:<br>    name: Sections<br>    singular_name: Section<br>    fields:<br>        title:<br>            type: text<br>            class: large<br>            group: content<br>        slug:<br>            type: slug<br>            uses: title<br>        template:<br>            type: templateselect<br>            filter: &#39;*_section.twig&#39;<br>    record_template: hero_section.twig<br>    taxonomy: [ order ]<br>    default_status: published<br>    viewless: true<br>    searchable: false</pre><p>Most of the settings should be self explanatory. As you can see, we defined <em>hero_section.twig</em> as default template. This is important when the user hasn’t selected a template via the template select. We will create it later.</p><p>We have also applied an <em>order</em> taxonomy, so we can define the position of each section.</p><h4>ORDER ALL THE THINGS (At Least the Sections)</h4><p>In order to make our sections sortable, we have to apply a taxonomy that has <em>has_sortorder</em> set to <em>true</em>. We have already applied a taxonomy named <em>order</em> to our <em>sections</em> contenttype, but it doesn’t exist yet. So let’s create it.</p><pre>order:<br>    slug: order<br>    singular_slug: orderfoo<br>    behaves_like: grouping<br>    has_sortorder: true<br>    options: { position: &quot;position&quot; }</pre><p>The last three settings are the important ones. It must behave like grouping, it must have at least one option, and of course, we want the ability to order the records with this taxonomy (in our case, the sections).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AkXj3pg5bSo1eP9KtUdmjQ.png" /></figure><p>When you now create a new section record, you’ll see a <em>taxonomy</em> tab where you can see your <em>order</em> taxonomy, with the <em>position</em> option. There you can set the position of your section.</p><p>That’s it! Now we are able to sort our sections.</p><h4>Building the Theme/ Templates</h4><p>Almost everything we need for our setup is in place. We can create sections and we can sort them. Now it’s time to build the theme.</p><p>Create a new folder for your theme inside the <em>theme</em> folder. You can name it like you want. I simply used <em>onepage</em> for that.</p><p>Now we need an <em>index.twi</em>g, a <em>config.yml</em> and our three example sections; <em>hero_section.twig</em>, <em>calltoaction_section.twig</em> and <em>threeentriesfeature_section.twig</em>.</p><p><strong>index.twig</strong></p><p>This is our main template. It contains our navigation and footer, and of course, it includes our sections. For simplicity, I’ll show you just the code to fetch all sections and how to include their selected template.</p><pre>{% set default_template = app.config.get(&#39;contenttypes/sections&#39;)[&#39;record_template&#39;] %}<br><br>{% setcontent sections = &#39;sections&#39; %}<br><br>{% for section in sections %}<br>    {% if section.template is not empty %}<br>	{% include section.template with {section: section} %}<br>    {% else %}<br>	{% include default_template with {section: section} %}<br>    {% endif %}<br>{% endfor %}</pre><p>First we get the default template for our <em>sections</em> contenttype. As you might remember, we set it to <em>hero_section.twig</em>. Then we fetch all our section records, which are already sorted by our <em>sort</em> taxonomy.</p><p>Finally we iterate over our section records and either include the selected or default template.</p><p><strong>config.yml</strong></p><p>This is our theme configuration. There we can give our templates legible names and set template fields.</p><blockquote>Template specific fields allow you to define extra fields to use when a template is chosen for a record.</blockquote><p>For now we just give our three section layouts a legible name. The template specific fields follow for each section layout.</p><pre>templateselect:<br>    templates:<br>        - filename: &quot;hero_section.twig&quot;<br>          name: &quot;Hero&quot;<br>        - filename: &quot;calltoaction_section.twig&quot;<br>          name: &quot;Call to Action&quot;<br>        - filename: &quot;threeentriesfeature_section.twig&quot;<br>          name: &quot;3 featured entries&quot;</pre><p><strong>hero_section.twig</strong></p><p>The first of our three section layouts is a simple full-width jumbotron from <a href="http://getbootstrap.com/">bootstrap</a>. It only needs a headline and a content field. Insert the following into your <em>config.yml</em>:</p><pre>templatefields:<br>    hero_section.twig:<br>        headline:<br>            type: text<br>            class: large<br>        content:<br>            type: html<br>            height: 200px</pre><p>The template itself is quite simple as well:</p><pre>&lt;section&gt;<br>    &lt;div class=&quot;jumbotron&quot; style=&quot;margin-bottom: 0px;&quot;&gt;<br>	&lt;div class=&quot;container&quot;&gt;<br>	    &lt;h1&gt;{{ section.templatefields.headline }}&lt;/h1&gt;<br>	    {{ section.templatefields.content }}<br>	&lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;/section&gt;</pre><p>Let’s create a new section and select the Hero template or stick with the default one (because it’s the same). You’ll see a <em>Template</em> tab where you can edit the content of your template fields for the Hero template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F_iJNGBRlB2AW2LV3oSRew.png" /></figure><p><strong>calltoaction_section.twig</strong></p><p>For this little Call to Action layout I use a bit of CSS from <a href="http://bootsnipp.com/snippets/featured/callouts-call-to-action">bootsnipp</a>. It has a headline, a content field and some pre-defined styles to choose.</p><p>Extend the <em>templatefields</em> entry in your <em>config.yml</em> with the following:</p><pre>calltoaction_section.twig:<br>    headline:<br>        type: text<br>        class: large<br>    content:<br>        type: html<br>        height: 200px<br>    style:<br>        type: select<br>        values: [ light, dark, bubble, block, mage ]</pre><p>The template isn’t very special too:</p><pre>&lt;div class=&quot;callout-{{ section.templatefields.style }} text-center fade-in-b&quot;&gt;<br>    &lt;div class=&quot;container&quot;&gt;<br>	&lt;div class=&quot;row&quot;&gt;<br>	    &lt;h1&gt;{{ section.templatefields.headline }}&lt;/h1&gt;<br>	    {{ section.templatefields.content }}<br>	&lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;/div&gt;</pre><p>Should be self explanatory, right?</p><p>Now do the same as above. Create a new section and select the <em>Call to Action</em> template. Now you have to save the section and reload the site. Otherwise the template fields for the <em>Call to Action</em> template won’t be loaded. The <em>Template</em> tab looks quite similar to the one from the Hero template but it has a select box for the style.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uKukF7O8ySOgjSNhS75ELw.png" /></figure><p><strong>threeentriesfeature.twig</strong></p><p>This one is a bit more complex. The plan is to select 3 records from the <em>entries</em> contenttype which will be shown next to each other.</p><p>We need a headline and three select fields where we can select records from the <em>entries</em> contenttype. As with the previous section, add the following to your <em>templatefields</em> entry:</p><pre>threeentriesfeature_section.twig:<br>    headline:<br>        type: text<br>        class: large<br>    entry_1:<br>        type: select<br>        values: entries/id,title<br>        autocomplete: true<br>        sort: title<br>    entry_2:<br>        type: select<br>        values: entries/id,title<br>        autocomplete: true<br>        sort: title<br>    entry_3:<br>        type: select<br>        values: entries/id,title<br>        autocomplete: true<br>        sort: title</pre><p>The select fields will only store the <em>id</em> of the selected entry. So we have to fetch the whole records in our template. It couldn’t be simpler as the following:</p><pre>{% setcontent entry_1 = &#39;entries/&#39; ~ section.templatefields.entry_1 %}<br>{% setcontent entry_2 = &#39;entries/&#39; ~ section.templatefields.entry_2 %}<br>{% setcontent entry_3 = &#39;entries/&#39; ~ section.templatefields.entry_3 %}<br><br>&lt;section style=&quot;padding-bottom: 20px;&quot;&gt;<br>    &lt;div class=&quot;container&quot;&gt;<br>	&lt;div class=&quot;row&quot;&gt;<br>	    &lt;div class=&quot;col-md-12&quot;&gt;<br>		&lt;h2 class=&quot;text-center&quot;&gt;{{ section.templatefields.headline }}&lt;/h2&gt;<br>	    &lt;/div&gt;<br>	&lt;/div&gt;<br>	&lt;div class=&quot;row&quot;&gt;<br>	    &lt;div class=&quot;col-md-4 div-col-sm-12&quot;&gt;<br>		&lt;h3 class=&quot;text-center&quot;&gt;{{ entry_1.title }}&lt;/h3&gt;<br>		{{ entry_1.teaser }}<br>	    &lt;/div&gt;<br>	    &lt;div class=&quot;col-md-4 div-col-sm-12&quot;&gt;<br>		&lt;h3 class=&quot;text-center&quot;&gt;{{ entry_2.title }}&lt;/h3&gt;<br>		{{ entry_2.teaser }}<br>	    &lt;/div&gt;<br>	    &lt;div class=&quot;col-md-4 div-col-sm-12&quot;&gt;<br>		&lt;h3 class=&quot;text-center&quot;&gt;{{ entry_3.title }}&lt;/h3&gt;<br>		{{ entry_3.teaser }}<br>	    &lt;/div&gt;<br>	&lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;/section&gt;</pre><p>Besides the <em>headline</em>, we also display the <em>title</em> and <em>teaser</em> of each selected entry.</p><p>Now do the same as with the previous ones and create a new section with your new template. Your <em>Template</em> tab will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SlRgChTYeWAQy7vMR-3quQ.png" /></figure><p>That’s it! We have built a simple One-Page site with 3 small and reusable section layouts. My examples use CSS classes from <a href="http://getbootstrap.com/">bootstrap</a>. When you include it in your <em>index.twig</em>, you’ll get a similar output to this when you have set up each section:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XR9O33zkId5ICluwaRkpQg.png" /></figure><p>You can also find the complete <a href="https://github.com/PhillippOhlandt/bolt-onepage-example">example on Github</a>.</p><p>I hope this has helped you to set up your or your clients One-Page site. This approach can also be used for configurable home or landing pages.</p><p>If you have further questions, just ask me on the <a href="http://slack.bolt.cm/">Bolt Slack Channel</a> (username: phillipp).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1055322a974e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bolt-cms/one-pager-made-easy-with-bolt-1055322a974e">One-Pager Made Easy with Bolt</a> was originally published in <a href="https://medium.com/bolt-cms">Bolt CMS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Reasons to Move Your WordPress Site to Bolt]]></title>
            <link>https://medium.com/bolt-cms/7-reasons-to-move-your-wordpress-site-to-bolt-f36159d93b19?source=rss----5901e0fe2a8a---4</link>
            <guid isPermaLink="false">https://medium.com/p/f36159d93b19</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[boltcm]]></category>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Phillipp]]></dc:creator>
            <pubDate>Sat, 06 Feb 2016 15:58:59 GMT</pubDate>
            <atom:updated>2016-02-06T17:41:59.430Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XvqAwCLeEsZOb5DPYQeVPw.png" /></figure><p>WordPress seems to be the all rounder for most things these days. People build almost everything with it. From a simple blog to a whole e-commerce site.</p><p>Unfortunately that isn’t the best decision because WordPress has some serious issues when it comes to stability, security and other stuff. There is also a big lack of quality in third party plugins and themes.</p><p>And here comes <a href="https://bolt.cm/">Bolt</a> into play.</p><blockquote>Bolt is an open source Content Management Tool, which strives to be as simple and straightforward as possible. It is quick to set up, easy to configure, uses elegant templates, and above all: It’s a joy to use.</blockquote><p>It makes many things a lot better and the following are the most important ones.</p><h4>Lightweight</h4><p>Bolt isn’t blown with lots of features people <em>could</em> need. It has a <em>“Do it as extension”</em> principle which leads to a cleaner CMS core and more specialized extensions.</p><h4>Fast</h4><p>Bolt is really performant, thanks to its lightweightness and optimized database queries. It also comes with an built-in cache system which can be used to cache generated thumbnails and even whole requests.</p><h4>Modern</h4><p>Bolt uses well tested composer packages like Silex and Symfony components to ensure quality and stability. There is no need to reinvent the wheel.</p><h4>Clean</h4><p>Bolt is written in object-orientated PHP, which leads to clean and maintainable code.</p><h4>Secure</h4><p>As already said, Bolt depends on highly adopted PHP packages to ensure the most possible security and fast bugfixes.</p><h4>Flexible</h4><p>Bolt has this concept of <em>contenttypes</em>, which will let you define everything on your own. Each contenttype you create gets its own database table with all the columns you define. This leads also in a much cleaner and less blown database.</p><h4>Better Templating</h4><p>Bolts uses Twig by default. It’s easy to use for beginners and provides good documentation. It also leads to cleaner templates because you can’t do dirty hacks as with vanilla PHP.</p><p>And this is not the end, there are lots of other advantages over WordPress but these are definitely the most important ones.</p><p>Do yourself a favor and try Bolt. It has a much smaller headache level than WordPress and some other CMS out there.</p><p>If you miss a feature, look for an extension in the <a href="https://extensions.bolt.cm/">Bolt Store</a> or ask in the <a href="https://discuss.bolt.cm/">forum</a>. There is always someone who will help out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f36159d93b19" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bolt-cms/7-reasons-to-move-your-wordpress-site-to-bolt-f36159d93b19">7 Reasons to Move Your WordPress Site to Bolt</a> was originally published in <a href="https://medium.com/bolt-cms">Bolt CMS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Things to Consider Before Publishing a Bolt Theme]]></title>
            <link>https://medium.com/bolt-cms/things-to-consider-before-publishing-a-bolt-theme-9b38a6d3392d?source=rss----5901e0fe2a8a---4</link>
            <guid isPermaLink="false">https://medium.com/p/9b38a6d3392d</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[themes]]></category>
            <category><![CDATA[boltcm]]></category>
            <dc:creator><![CDATA[Phillipp]]></dc:creator>
            <pubDate>Thu, 28 Jan 2016 18:15:32 GMT</pubDate>
            <atom:updated>2016-01-28T19:17:17.776Z</atom:updated>
            <content:encoded><![CDATA[<p>Bolt makes it quite easy to create a theme from scratch or to <a href="http://leftontheweb.com/blog/2015/10/23/Creating_a_Bolt_theme_from_a_template/">port an existing one</a>. But when it comes to publishing your newly created theme, make sure you take care of the following things:</p><h4>Screenshot all The Things!</h4><p>Show the world how cool your theme is and provide at least one screenshot. In the best case, you provide screenshots from the <em>homepage</em>,<em> listing page</em> and <em>detail page</em>.</p><p>In order to link them with your theme, you have to reference them in your theme’s <em>composer.json</em>.</p><p>Let’s say we have <em>home.jpg</em>, <em>listing.jpg</em> and <em>detail.jpg </em>stored inside a <em>screenshots</em> folder. Your <em>extra</em> section in your <em>composer.json</em> would look like this:</p><pre>&quot;extra&quot;: {<br>    &quot;bolt-screenshots&quot;: [<br>        &quot;screenshots/home.jpg&quot;,<br>        &quot;screenshots/listing.jpg&quot;,<br>        &quot;screenshots/detail.jpg&quot;<br>    ]<br>}</pre><h4>Setup a Readme</h4><p>Most simple themes will work out of the box. But if your theme has special functions or require some configuration to work, the <em>README.md</em> is your place to go for all these information.</p><p>Even if your theme is quite simple, it doesn’t hurt to put a quick description and installation instructions in there.</p><h4>The Publishing Process</h4><p>If all previous tasks are done, then you are almost ready to add your theme to the <a href="https://extensions.bolt.cm/">Bolt Store</a>.</p><p>I suggest you to <a href="https://git-scm.com/book/en/v2/Git-Basics-Tagging">tag a new release</a> on your git repository. That could be either <em>1.0</em> or <em>0.1</em>, depending on the current state of your theme. A good approach is to follow <a href="http://semver.org/">semantic versioning</a>.</p><p>Now you are prepared to add it to the Bolt Store. I won’t explain the whole process in detail, because it’s straightforward.</p><p>You log into your account, click on <em>Submit an Extension</em>, fill in all details and hit the submit button.</p><p>For the description field, it’s a good thing to put in a note that the user can find more information in your readme file on github.</p><h4>The Update Process</h4><p>Now the git tags come into play. When you push an update for your theme, you should increase the version number with a new git tag.</p><p><strong>The most important step</strong> is to hit the <em>Update</em> button in the Bolt Store. You’ll find it when you login to your account and click on <em>Your Profile</em>. Without this, Bolt wouldn’t notice the update and your users may miss it.</p><p>I hope this helped you with your theme and publishing process. If you have further questions or problems, don’t be shy and just ask me in the <a href="http://slack.bolt.cm/">Bolt Slack Channel</a> (username: phillipp)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b38a6d3392d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bolt-cms/things-to-consider-before-publishing-a-bolt-theme-9b38a6d3392d">Things to Consider Before Publishing a Bolt Theme</a> was originally published in <a href="https://medium.com/bolt-cms">Bolt CMS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make Sure Your Resource Records Are Present]]></title>
            <link>https://medium.com/bolt-cms/make-sure-your-resource-records-are-present-1d1f69a9b1d4?source=rss----5901e0fe2a8a---4</link>
            <guid isPermaLink="false">https://medium.com/p/1d1f69a9b1d4</guid>
            <category><![CDATA[template]]></category>
            <category><![CDATA[boltcm]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Phillipp]]></dc:creator>
            <pubDate>Fri, 22 Jan 2016 07:36:46 GMT</pubDate>
            <atom:updated>2016-01-28T18:14:38.956Z</atom:updated>
            <content:encoded><![CDATA[<p>Sometimes your theme needs specific information besides the normal content. Short text snippets or social media usernames for example.</p><p>In Bolt, it’s best practice to create key-value-like <a href="https://docs.bolt.cm/howto/resource-contenttype">resource contenttypes</a> for those kinds of things. Well, you could also store them in your config file but resource contenttypes give a much better user experience for clients.</p><p>Let’s continue with an example about social media usernames you want to link in the footer of your template. Your resource contenttype could look like this:</p><pre>social:<br>    name: Social Media<br>    singular_name: Social Media<br>    fields:<br>        title:<br>            type: text<br>            class: large<br>        slug:<br>            type: slug<br>            uses: title<br>        name:<br>            type: text<br>    default_status: published<br>    show_on_dashboard: false<br>    searchable: false<br>    viewless: true</pre><p>This allows you to create one record per social network and use them like this:</p><pre>{% setcontent twitter = &#39;social/twitter&#39; %}<br>{% setcontent github = &#39;social/github&#39; %}</pre><pre>&lt;a href=&quot;https://twitter.com/{{ twitter.name|raw }}&quot;&gt;Twitter&lt;/a&gt;<br>&lt;a href=&quot;https://github.com/{{ github.name|raw }}&quot;&gt;Github&lt;/a&gt;</pre><h4>The Problem</h4><p>The above example assumes you have a record with the slug <em>‘twitter’</em> and another with the slug <em>‘github’</em>.</p><p>Depending on your workflow, you may have your local development environment, a staging server and a production server. Maybe an automated deployment too.</p><p>This means you have to create the above two records on all systems by hand, so your client can edit them. And if you add another one like <em>‘facebook’</em>, you have to update all three environments again.</p><p>With three records this isn’t a big deal but what if your theme depends on 10 or 20 different resource records? A way to automate this would be awesome, right?</p><h4>The Solution</h4><p>Today is your lucky day! I have built an extension that does exactly this! You can find it on <a href="https://github.com/PhillippOhlandt/bolt-extension-required-records">Github</a> and in the <a href="http://extensions.bolt.cm/view/452eb1f2-bf69-11e5-bf25-14cdca8e654f">Bolt Extension Store</a>.</p><p>I’ll skip the installation and continue with the configuration. It’s as simple as adding a ‘require’ key to the contenttype.</p><pre>social:<br>    name: Social Media<br>    singular_name: Social Media<br>    fields:<br>        title:<br>            type: text<br>            class: large<br>        slug:<br>            type: slug<br>            uses: title<br>        name:<br>            type: text<br>    required:<br>        - slug: twitter<br>          title: Twitter<br>        - slug: github<br>          title: Github<br>    default_status: published<br>    show_on_dashboard: false<br>    searchable: false<br>    viewless: true</pre><p>Now browse to <em>‘Extras’</em> =&gt; <em>‘Required Records’</em> to see an overview of all your required and missing records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*sevn1cRjjEhfIpnhUUDs2Q.png" /></figure><p>Here you can see we require the <em>‘twitter’</em> and <em>‘github’</em> records in the ‘social’ contenttype and that they’re not present yet. You can create them by hitting the <em>‘Add Records’</em> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*mehMEg1v_FgomERS8gjhfA.png" /></figure><p><strong>That’s all!</strong> Just one click and they are all created.</p><p>Well, they don’t have the important content yet, but your client can see and fill them with content.</p><p>If you use an automated deployment, you can execute the <em>‘app/nut required-records:create’</em> command to create all missing records.</p><p>I hope this extension helps you to save some time. If so, let me know in the comments or in the <a href="http://slack.bolt.cm/">Bolt Slack Channel</a>. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d1f69a9b1d4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bolt-cms/make-sure-your-resource-records-are-present-1d1f69a9b1d4">Make Sure Your Resource Records Are Present</a> was originally published in <a href="https://medium.com/bolt-cms">Bolt CMS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create a Liveblog with Bolt and Pusher]]></title>
            <link>https://medium.com/bolt-cms/how-to-create-a-liveblog-with-bolt-and-pusher-7b887de16ec8?source=rss----5901e0fe2a8a---4</link>
            <guid isPermaLink="false">https://medium.com/p/7b887de16ec8</guid>
            <category><![CDATA[boltcm]]></category>
            <category><![CDATA[realtime]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Phillipp]]></dc:creator>
            <pubDate>Wed, 21 Oct 2015 19:16:00 GMT</pubDate>
            <atom:updated>2016-01-28T20:59:55.245Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sYgUqJkUag5qDf3ZMFxJpA.png" /></figure><p>Imagine there is an event for something and you want to blog about it. Depending on the event, there can be much information in a short amount of time. And your visitors have to reload your page again and again. Which isn’t good for anyone. Neither your users nor your server.</p><p><strong>The solution?</strong> Update your blog in realtime so your visitors can stay on the page while new posts are flying in like magic.</p><p>For this tutorial I use <a href="https://bolt.cm/">Bolt</a> as CMS and <a href="https://pusher.com/">Pusher</a> to push new posts through websockets to the visitors.</p><h4>Install and configure Bolt</h4><p>There are a few different ways to install Bolt and they are all well described <a href="https://docs.bolt.cm/installation">here</a>. It’s up to you how and where you want to install it so I will continue with the configuration. <em>(Note: Current stable version is v2.2.13)</em></p><p>Now we need a theme. We can use the standard <em>base-2014</em> theme but it’s not specifically for blogs so I chose <a href="http://extensions.bolt.cm/view/4db383c5-56da-11e4-866c-43d66b93a270"><em>clean-blog</em></a> for this tutorial.</p><p>Let’s install it. Go into your Bolt backend and browse to <em>Extras &gt; View/Install Extensions</em>. Start typing “clean-blog” into the input field until you see a dropdown with the theme name. Click on it so it fills out the input field. Click on <em>Browse Versions</em> and install the latest stable one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*AyfiiKV3q3Dk2JhIeY-oMw.png" /><figcaption>You always want the last stable one.</figcaption></figure><p>After the installation is done, you will find the theme in the list of <em>Your currently Installed Extensions</em>. If not, reload the page. Before we can go over to the config file, you have to hit the <em>Copy to theme folder</em> button on the list entry.</p><p>Time to edit the config file and to tell Bolt to use our new installed theme. Open <em>app/config/config.yml</em> with your favorite editor or browse to <em>Configuration &gt; Main configuration</em> in your Bolt backend.</p><p>Here you can change the name of the theme you want to use. You are also free to change some other settings like <em>sitename</em> and <em>payoff</em>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/34f02e81efa3358f9cce8e31a555d9f3/href">https://medium.com/media/34f02e81efa3358f9cce8e31a555d9f3/href</a></iframe><h4>Enable Pusher</h4><p>I assume you already have a Pusher account. If not, <a href="https://pusher.com/signup">register here</a> for free.</p><p>To integrate Pusher into our Bolt installation, we can simply use the extension <em>pusher-realtime</em> by — surprise surprise — me.</p><p>The installation is quite the same as with the theme. After the installation, you’ll find a button called <em>config</em> in the list entry of the extension. This button will open the configuration file for the extension in the backend.</p><p>Like the Bolt configuration file, you can also edit it with your favorite editor. The file is located under <em>app/config/extensions/pusher-realtime.ohlandt.yml</em>.</p><p>Before we can edit it, you have to create a new App in your Pusher Dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SCNjMqtY_M-hRZWOid3kyA.png" /><figcaption>Create a new Pusher App (You have to scroll down in the overlay to see the save button)</figcaption></figure><p>After you created the Pusher App, you will be redirected to the <em>App Keys</em> page that contains instructions on how to use Pusher and your App Keys on the right side.</p><p>Copy the keys over to the extension configuration file and make sure there is a space between the colon and the value (YAML Syntax). Leave everything else like it is.</p><h4>Final Changes on the Theme</h4><p>Our goal is to have a blog that will be updated in realtime when we save a new entry. The <em>clean-blog</em> theme comes with a simple index page that lists all recent posts. Perfect for our Pusher integration.</p><p>Go to <em>theme/clean-blog</em> in your preferred file manager. Here we will edit two files, <em>index.twig</em> and <em>_head.twig</em>.</p><p><strong>index.twig:</strong> This file contains the loop that displays our recent entries. We change the number of the loaded entries to 20, display the entry body instead of the teaser, remove the metadata and add the class <em>entries</em> to the parent div. The content area will look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0680acce1af095604c5502dbab0a0c55/href">https://medium.com/media/0680acce1af095604c5502dbab0a0c55/href</a></iframe><p><strong>_head.twig:</strong> In this file we enable Pusher through a helper function from the <em>pusher-realtime</em> extension. Then we will listen for the <em>created</em> event in the <em>records</em> channel and insert new posts into the page. Paste the following code right before the<em>&lt;/head&gt;</em> HTML tag.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1245fb32b3750d7139290cd4b751983f/href">https://medium.com/media/1245fb32b3750d7139290cd4b751983f/href</a></iframe><p>You are done! Your blog will update itself in realtime when you post something new. Here is a preview:</p><p><a href="http://recordit.co/qJxRMdnki5">http://recordit.co/qJxRMdnki5</a></p><p>You will find more information about Pusher and the <em>pusher-realtime</em> extension in the <a href="https://pusher.com/docs">Pusher Documentation</a> and in the <a href="https://github.com/PhillippOhlandt/bolt-extension-pusher-realtime">Extension Readme</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b887de16ec8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bolt-cms/how-to-create-a-liveblog-with-bolt-and-pusher-7b887de16ec8">How to Create a Liveblog with Bolt and Pusher</a> was originally published in <a href="https://medium.com/bolt-cms">Bolt CMS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>