<?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[Stories by Phillipp on Medium]]></title>
        <description><![CDATA[Stories by Phillipp on Medium]]></description>
        <link>https://medium.com/@PhillippOhlandt?source=rss-1e1beaa250f5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*WLMnSdq1SFLx5sx4.jpg</url>
            <title>Stories by Phillipp on Medium</title>
            <link>https://medium.com/@PhillippOhlandt?source=rss-1e1beaa250f5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 01:23:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@PhillippOhlandt/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[DevBlog 1: User Authentication]]></title>
            <link>https://medium.com/ultimate-sgc-co/devblog-1-user-authentication-3d0460891b03?source=rss-1e1beaa250f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d0460891b03</guid>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[phoenix-framework]]></category>
            <category><![CDATA[stargate]]></category>
            <category><![CDATA[devblog]]></category>
            <dc:creator><![CDATA[Phillipp]]></dc:creator>
            <pubDate>Fri, 27 Oct 2017 20:32:40 GMT</pubDate>
            <atom:updated>2017-10-27T20:32:40.599Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is part of a series of devblogs for my alternative </em><a href="https://www.stargatecommand.co/"><em>Stargate Command</em></a><em> web client. Read the introduction </em><a href="https://medium.com/ultimate-sgc-co/devblog-0-the-mission-390dcf6475e4"><em>here</em></a><em>.</em></p><p>The very first thing I did after I got the idea to create an alternative web client for <a href="https://www.stargatecommand.co/">Stargate Command</a> was to figure out how I can authenticate as an existing user. Basically, the whole project depended on whether this is possible.</p><p>Since it’s not intended that third party applications authenticate a user, there is no proper API I could use. The best way to go in this case is to figure out how the normal web login works and do the exact same steps programmatically.</p><h4>Debugging the Web Login Using Chrome Developer Tools</h4><p>I simply used the Chrome Developer Tools to record all HTTP requests during the login so I can see exactly what’s being sent back and forth. It’s important to check “Preserve log”, otherwise we will lose all recorded requests when the page reloads. I also deleted all existing cookies so we start from a clean slate.</p><p>The screenshot below shows the first request to the homepage. You can see we are getting 3 cookies. <em>_TopFan-BCK_session</em>, <em>guest_user_id</em> and <em>session_id</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R70OJ4Gl_x6OXD0WoIG1bg.png" /></figure><p>We are now ready to fill in our login credentials and hit the submit button. The login POST request is made via AJAX from the web client, that will be handy for our implementation since a successful login will return a 200 OK response instead of a redirect.</p><p>In the screenshot below you can see that we are sending our login credentials, along with a CSRF token, as form data to the login endpoint. The response contains a new <em>_TopFan-BCK_session</em> cookie and we are logged in. At this point, the javascript web client simply reloads the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0c59oPwE2bV_6pYM3E845A.png" /></figure><p>After the page is reloaded, the returned HTML contains our user info as seen below. The HTML is badly formatted so the screenshot just contains the URL to the user profile, but we are definitely logged in at this point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EaIuYgtyPL4UlbT3PuYudw.png" /></figure><p>We also got a new <em>_TopFan-BCK_session</em> cookie again. In fact, every request to their servers will return a new <em>_TopFan-BCK_session</em> cookie. This is important for our implementation later on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cy_7ybGijzTisrOtcq1COw.png" /></figure><h4>Login Procedure Step by Step</h4><p>From what we found out, we can say the login works as follows:</p><ol><li>Request any site on stargatecommand.co and grab the cookies &amp; CSRF token.</li><li>Post the login credentials along with the CSRF token and cookies to the login endpoint.</li><li>Correct credentials will return a 200 OK status and a new <em>_TopFan-BCK_session</em> cookie.</li><li>Merge the new <em>_TopFan-BCK_session</em> cookie with the existing <em>guest_user_id</em> and <em>session_id</em> cookies to have an updated cookie set for future requests.</li></ol><p>The currently implemented login function looks like this. It exactly covers the steps above.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb1807d8b70afe8f825afc089de31eb7/href">https://medium.com/media/fb1807d8b70afe8f825afc089de31eb7/href</a></iframe><h4>The Complete Workflow</h4><p>The login function works but we’re not done yet. The user session has to be persisted on our own client. The goal is to not store them in any database so the easiest and also simplest solution is to store our 3 cookies the same way they are stored on the <a href="https://www.stargatecommand.co/">Stargate Command</a> platform, on the user’s browser.</p><p>This is the complete login workflow:</p><ol><li>User submits the login form on our client with their credentials.</li><li>Our client calls the login function and obtains the cookies from <a href="https://www.stargatecommand.co/">Stargate Command</a>.</li><li>If the login was successful, our client sends the cookies to the user so they can be stored in the browser.</li></ol><p>And whenever the user uses our client which needs to interact with <a href="https://www.stargatecommand.co/">Stargate Command</a>, it goes as follows:</p><ol><li>The user visits a profile page. The request to our client contains the stored cookies.</li><li>Our client uses those cookies to request the profile information on behalf of the user.</li><li><a href="https://www.stargatecommand.co/">Stargate Command</a> proceeds the request as if it’s a normal request by the user and returns the profile and another <em>_TopFan-BCK_session</em> cookie.</li><li>The profile data and the new cookie set gets returned to the user of our client.</li></ol><h4>Is It Secure?</h4><p>It’s as secure as the normal usage of the <a href="https://www.stargatecommand.co/">Stargate Command</a> platform from a crypto standpoint. While all the cookies are stored on the user’s device, they still go through my own client. I will run the <a href="https://github.com/PhillippOhlandt/ultimate-sgc.co">open-sourced, public version</a> without any modifications. If you don’t trust me or just simply want to host it on your own, you are free and encouraged to do so.</p><h4>Little Demo</h4><p>This is a small demo of the described process. It also fetches the information of the logged in user from <a href="https://www.stargatecommand.co/">Stargate Command</a>. We’ll explore that in a later article.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnNBZ15En7PU%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnNBZ15En7PU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnNBZ15En7PU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f9136ad8764c80c4a9ea13917015601c/href">https://medium.com/media/f9136ad8764c80c4a9ea13917015601c/href</a></iframe><p>This article is part of a <a href="https://medium.com/ultimate-sgc-co">DevBlog</a> where I show my findings and explain the technical implementations of my alternative <a href="https://www.stargatecommand.co/">Stargate Command</a> web client. If you like what I do, leave some claps and follow the publication to stay up to date :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d0460891b03" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ultimate-sgc-co/devblog-1-user-authentication-3d0460891b03">DevBlog 1: User Authentication</a> was originally published in <a href="https://medium.com/ultimate-sgc-co">Ultimate SGC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevBlog 0: The Mission]]></title>
            <link>https://medium.com/ultimate-sgc-co/devblog-0-the-mission-390dcf6475e4?source=rss-1e1beaa250f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/390dcf6475e4</guid>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[stargate]]></category>
            <category><![CDATA[devblog]]></category>
            <category><![CDATA[phoenix-framework]]></category>
            <dc:creator><![CDATA[Phillipp]]></dc:creator>
            <pubDate>Tue, 24 Oct 2017 10:25:32 GMT</pubDate>
            <atom:updated>2017-10-24T10:25:32.871Z</atom:updated>
            <content:encoded><![CDATA[<p>I am a huge Stargate fan so I was very excited about the release of <a href="https://www.stargatecommand.co/">stargatecommand.co</a> a few weeks ago. The plarform is a project by MGM, meant as central community platform for the Stargate franchise.</p><p>The platform contains news &amp; insights about the franchise, where registered users can discuss all things Stargate in the forum. Those who bought the All-Access pass for $20 can stream all Stargate series and movies on web &amp; mobile. It’s also the only place to watch the upcoming mini-series Stargate Origins.</p><p>Unfortunately, it’s quite frustrating to use the platform as it is now. The frontend client feels buggy and slow and the UX is far from being good.</p><p>Another user and I did some research and figured out who developed the platform. MGM didn’t create it on their own. They licensed it from a company called <a href="http://www.topfan.com/">TopFan</a> which sells and maintains those community platforms for their clients. They are basically all the same, just with different styles and feature sets.</p><h4>So What Are the Problems with the Community Platform?</h4><p>They are hosting it on Heroku and for some reason they can not or do not want to scale it properly. So on high load, the requests take ages or simply time out (due to 30 sec timeout on Heroku). This wouldn’t be such a huge issue if the frontend client wouldn’t completely freeze on every single API request. The JS part of the frontend feels very buggy and unresponsive in general.</p><p>Another problem is that the forum part of the platform is an unorganized mess. They wanted it to look like Twitter but that just doesn’t work for a discussion forum. Many people already asked for categories for better organization.</p><p>The web version also hides some information, like the user notifications. Their mobile apps are way better in making those things visible.</p><p>Those are just the bigger issues I can think of now. There are a lot more smaller ones around UX and design, which make the usage of the platform less enjoyable.</p><h4>Can You Solve Those Problems and What Is Your plan?</h4><p>Yes, most of them can be solved, except when the platform doesn’t respond due to high load.</p><p>The plan is to create an alternative web client which uses all the original data but provides a better frontend. The user should be able to login with their original Stargate Command account and use the new client as it were the original one.</p><p>For the beginning the focus is on the forum and user system as they are the most used parts with the most usability problems. Other features like news posts and quizzes will follow afterwards. The only feature that won’t be implemented is the streaming of the Stargate series and movies because they are DRM protected.</p><h4>What Is Your Tech stack?</h4><p>I will be using <a href="https://elixir-lang.org/">Elixir</a> and the <a href="http://phoenixframework.org/">Phoenix Framework</a> for the backend part. The backend acts as some sort of API proxy between my own API and the internal API of <a href="https://www.stargatecommand.co/">stargatecommand.co</a>. That way I can use the original data from Stargate Command and don’t need to store anything.</p><p>For the frontend I plan to use <a href="https://vuejs.org/">VueJS </a>because it’s lightweight and I am very comfortable with it. I won’t create a full SPA though. I am a bit oldschool and prefer server rendered HTML and just inject JS components where I need interactivity.</p><p>The idea of this <a href="https://medium.com/ultimate-sgc-co">Medium publication</a> is to have a place for a series of dev blogs where I show my findings and explain the technical implementations of my alternative Stargate Command web client.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=390dcf6475e4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ultimate-sgc-co/devblog-0-the-mission-390dcf6475e4">DevBlog 0: The Mission</a> was originally published in <a href="https://medium.com/ultimate-sgc-co">Ultimate SGC</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-1e1beaa250f5------2</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:40 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-1e1beaa250f5------2</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-1e1beaa250f5------2</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-1e1beaa250f5------2</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-1e1beaa250f5------2</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-1e1beaa250f5------2</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:21 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-1e1beaa250f5------2</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:45 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-1e1beaa250f5------2</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:11:59 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>