<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>CVW Web Design Blog</title>
        <link>https://www.cvwdesign.com/blog/</link>
        <description>Articles about web design and development from the perspective of a UK-based freelancer</description>
        <atom:link href="https://www.cvwdesign.com/blog/rss.php" rel="self" type="application/rss+xml" />
                <item>
           <title>Adding site styles to Redactor editor in Perch</title>
           <link>https://www.cvwdesign.com/blog/adding-site-styles-to-redactor-editor-in-perch</link>
           <guid>https://www.cvwdesign.com/blog/adding-site-styles-to-redactor-editor-in-perch</guid>
           <description><![CDATA[<p>With many of my <a href="https://grabaperch.com">Perch CMS</a> sites, I use <a href="https://imperavi.com/redactor/">Redactor editor</a> which is installed as a&nbsp;Perch core file. I like the editor (although it has a few quirks on occasion).&nbsp;</p>
<p>Redactor doesn't have any kind of preview mode although drafts can be previewed in Perch itself.&nbsp;So, on some of my personal sites, I find it's nice&nbsp;to have another "preview" option, between page preview and a full editor live preview mode. I do this by adding some of my site styles to the Redactor editor text area. I realise that there are some caveats with this approach (what if the styles change from page to page?) and that this isn't for everyone or for every site. However, it's relatively simple to do and here's how.</p>
<p>Firstly, you will need <a href="https://docs.grabaperch.com/api/custom-ui/">a custom style sheet for the Perch UI</a>. Now, you can add styles for the <code>&lt;div&gt;</code> that wraps the editor's text area. This normally has a class called <code>redactor-styles</code>.</p>
<p>Here are two that I've used on another site:</p>
<pre>
.redactor-styles .highlighted { 
   background-color: #efefef;
   padding: 1em;
}
.redactor-styles blockquote { 
   background-color: #e0e0f4; 
   border-left: 5px solid #66c; 
   padding: 1em;
}</pre>
<p>In the first case, my site has a <code>highlighted</code> class on some paragraphs. I can add this by editing the source (source button) in Redactor. Then, my custom style sheet rule means I can see this in the editor.</p>
<p>In the second case, I've added my <code>&lt;blockquote&gt;</code> site styles.</p>
<p>I like to have more padding on both these elements in the editor as well :-)</p>
<p>There are other things you can do. Perhaps it would be useful to have the heading styles more like the site? Or, you may want to <a href="http://forum.grabaperch.com/forum/10-29-2018-simplemde-text-size-in-textarea">increase the text size for SimpleMDE editor</a>. Anyway, I hope this post has given you a few ideas.</p>]]></description>
           <pubDate>Wed, 31 Oct 2018 09:29:00 +0000</pubDate>
        </item>
        <item>
           <title>Working with Perch</title>
           <link>https://www.cvwdesign.com/blog/working-with-perch</link>
           <guid>https://www.cvwdesign.com/blog/working-with-perch</guid>
           <description><![CDATA[<p>I love working with <a href="https://grabaperch.com">Perch CMS</a> and it's a very flexible and powerful system. Here's my Perch workflow and a few of my favourite things about working with it.</p>
<h2>Layouts and pages</h2>
<p>On a new site build, I build a static page(s) first. Once I have 2-3 pages (or sometimes only a single page), I add <a href="https://docs.grabaperch.com/perch/pages-and-nav/layouts/">Perch layouts</a> for common elements, for example <code>&lt;head&gt;</code>, <code>&lt;footer&gt;</code>, navigation menus etc. I might have .html files at the start of the process but I change to .php when adding Perch layouts. The .html pages are kept if I think I need them as a reference.</p>
<p>The Perch layouts are just static HTML at the start. I'm really just using Perch layouts like PHP includes at this point. For example, for site navigation, I have a static menu and I change to a Perch-driven menu later depending on the site requirements. </p>
<p>I might have a couple of Perch layouts for the <code>&lt;head&gt;</code> element because I like having a separate blog/news layout. I don't use <a href="https://docs.grabaperch.com/perch/pages-and-nav/layouts/variables/">layout variables</a> much. Note to self: Maybe I should use them more.</p>
<ul><li><strong>Tip</strong>: Use page attributes to add canonical links into your pages for SEO purposes - as <a href="http://simoncox.com/article/how-i-add-canonicals-into-perch-cms-sites">described by Simon Cox</a>.</li></ul>
<h2>Blocks</h2>
<p>For site content, I use <a href="https://docs.grabaperch.com/templates/blocks/">Perch Blocks</a> as much as I can. For instance, on <a href="https://www.cvwdesign.co.uk">CVW Web Design</a>, each page has a single "Page Content" region and this is assigned to a "Content - Blocks" template that has six items, for example "Text in Columns", "Heading and Strapline", "Content Row" etc. When adding content, I just choose different items for each page.</p>
<blockquote>I want my pages to be a series of instructions</blockquote>
<p>Each Block has all the mark-up needed to display that section of the page. I want my pages to be a series of instructions for PHP/Perch and this modular approach enables that.</p>
<p>Of course, for some clients, a page full of editable fields in Perch admin isn't the best approach and in these cases, I would separate out page content into separate regions.</p>
<ul><li><strong>Tip</strong>: Use <a href="https://docs.grabaperch.com/templates/includes/">template includes</a> to make Blocks and templates easier to manage.</li></ul>
<h2>Editors</h2>
<p>I use Redactor most of the time because I've never been very keen to give clients an editor with Markdown. I'm not saying that clients won't/cannot learn Markdown but I just think this is another unknown for clients at the start of their CMS experience. And that's something I want to avoid.</p>
<p>I've used SimpleMDE editor on personal sites. I like it for my own use.</p>
<h2>Perch admin</h2>
<p>For Perch admin, I add a few custom styles similar to what <a href="https://www.cvwdesign.com/blog/did-you-know-you-can-customise-the-perch-admin-user-interface">Graham Street describes</a>. I think this differentiates some areas of the admin better.</p>
<h2>Apps</h2>
<p>I use Blog and Forms apps the most. For the blog post page, I get the post data at the start of the page and add it into a <code>$post</code> variable that I can use anywhere on the page. This is different to the example post page that comes with the Perch blog add-on but it works better in many cases.</p>
<p>For third party apps, I like <a href="https://grabachirp.com">Chirp SEO</a> and the <a href="https://github.com/ImpressionEngineering/Perch-Backup-Status-Dashboard-Widget">Runway Backup Status Dashboard Widget</a></p>
<p>... and <a href="https://www.cvwdesign.com/blog/perch-dashboard-links-widget">Perch Dashboard Links widget</a> :-)</p>
<hr>
<p>This is a short description of my Perch workflow. However, I hope it highlights a few things that will be useful for anyone working with Perch CMS.</p>]]></description>
           <pubDate>Tue, 17 Jul 2018 08:15:00 +0000</pubDate>
        </item>
        <item>
           <title>Perch Dashboard Links Widget</title>
           <link>https://www.cvwdesign.com/blog/perch-dashboard-links-widget</link>
           <guid>https://www.cvwdesign.com/blog/perch-dashboard-links-widget</guid>
           <description><![CDATA[<p>I've been working on a <a href="https://github.com/clivewalker/Perch-Dashboard-Links-Widget">Perch Dashboard Links widget</a>. I wrote a <a href="/blog/creating-a-perch-dashboard-widget-for-google-analytics">Google Analytics widget</a> a while back but haven't followed that up. So, I thought it was time to relearn a few things about Perch widgets.</p>
<p>The Dashboard widget is pretty simple. It enables a Perch admin user (or someone with access to Perch CMS admin Settings page) to add up to three links which are displayed as a widget on the Perch dashboard. The user can change the widget heading as well. Exciting, I know ;-)</p>
<p>I'm a big fan of this type of "side project" even if it's a simple example (like this). I learned things from doing it. During the development, a few issues came up that I hadn't thought of at the start so they had to be fixed. And I realised that there are probably a few smarter ways of doing things if I take the widget further. All part of the learning process.</p>
<p>I encourage everyone to do something like this. And to write about it. Even if you side project is not a full-blown app/add-on or you don't get very far with it, I still think it's worth posting a few words about it.</p>]]></description>
           <pubDate>Thu, 17 May 2018 09:54:00 +0000</pubDate>
        </item>
        <item>
           <title>A custom Help page for Perch CMS</title>
           <link>https://www.cvwdesign.com/blog/a-custom-help-page-for-perch-cms</link>
           <guid>https://www.cvwdesign.com/blog/a-custom-help-page-for-perch-cms</guid>
           <description><![CDATA[<p>There are several ways to <a href="https://docs.grabaperch.com/perch/content/templates/adding-help-text/">add Help text</a> to <a href="https://grabaperch.com">Perch CMS</a> page templates and regions. But, did you know, it's also possible to add a custom Help page for your users? Yes, there's a Setting for that!</p>
<p>A link to the default Perch Help page is on the top menu bar next to the Log Out button. The URL for this link can be changed to your own Help page. This would be useful to showcase Help tips that are important or especially relevant to your site's users, for example screencast videos.</p>
<p>In Perch -&gt; Settings, there's a Help button URL field. Just add your own Help page link here, for example <code>/help.php</code> perhaps. This page could also be part of the Perch pages for your site so that users could add their own tips.&nbsp;</p>
<ul><li><strong>Related</strong>: <a href="http://forum.grabaperch.com/forum/10-20-2016-perch-manual-for-clients">Perch Manual for Clients</a></li></ul>]]></description>
           <pubDate>Thu, 26 Oct 2017 12:20:00 +0000</pubDate>
        </item>
        <item>
           <title>A list of Perch CMS add-ons by third party developers</title>
           <link>https://www.cvwdesign.com/blog/a-list-of-perch-cms-add-ons-by-third-party-developers</link>
           <guid>https://www.cvwdesign.com/blog/a-list-of-perch-cms-add-ons-by-third-party-developers</guid>
           <description><![CDATA[<p><strong>Update</strong> <em>August 2018</em>: I've created a new <a href="https://github.com/clivewalker/perchology-links">list of third party apps and add-ons</a> that I will be updating regularly. Anyone can fork the repository and send in a pull request as well.</p>
<hr>
<p>I have been including Perch CMS add-ons by third party developers in the <a href="https://www.perchology.com">Perchology newsletter</a> since it started. Yet, there's no list or "marketplace" for add-ons. For my own benefits, I've started keeping a list and I thought it would be useful to publish this. Here it is.<br></p>
<p>I've tried to only include apps/add-ons that have been updated in the last year. However, please check each link to see when they were updated and/or contact the authors for compatibility information with Perch 2 or 3.</p>
<ul><li><a href="https://grabachirp.com">Chirp SEO</a> gives Perch content editors the ability to analyse their content, and improve their on-site SEO. Add a keyword search phrase and check your content. Works with pages, collections Perch Blog add-on, Perch Shop.</li>
<li><a href="https://github.com/RedFinch/Perch-Image-Optim">Perch Image Optimiser</a> reduces the size of uploaded images.</li>
<li><a href="https://github.com/RedFinch/Perch-Event-Log">Event Logger</a> tracks the activity of users. Useful for helping clients or for auditing your content editors.</li>
<li><a href="https://github.com/RootStudio/Perch-Locator">Perch Locator</a> for managing locations. Addresses are Geocoded and can be searched using coordinates or by a valid address to allow users to find places of interest near to them.</li>
<li><a href="https://github.com/PepperJack/Perch-member-tags">Member Tags</a> gives administrators the ability to view and edit all tags used by the Perch Members app</li>
<li><a href="http://github.com/DexterHarrison/dh_member_profiles">Member Profiles</a> for displaying profiles of members created with Perch Members.</li><li><a href="https://grabapipit.com/pipits/apps/catalog">Pipit Catalog</a> provides an alternative listing page for Perch Shop products with image thumbnails and filtering options. It also highlights sale and stock states.</li><li><a href="https://grabapipit.com/pipits/apps/sharing/">Pipit Sharing</a> for sharing links to sites like Twitter and Facebook.</li>
<li><a href="https://github.com/scottgruber/pixelfix_shortcodes">Pixelfix Shortcodes</a> is an app to build support for Perch shortcodes.</li><li><a href="http://yellowbeetle.co.uk/ybforum/">YB Forum</a> is a forum add-on. Users can add/edit posts to new or existing topics. Posts need to be moderated before they appear on the forum.</li></ul>
<p>If you know other add-ons, let me know in the Comments, and I'll update the list. Thanks!<br></p>]]></description>
           <pubDate>Wed, 27 Sep 2017 09:47:00 +0000</pubDate>
        </item>
        <item>
           <title>How to customise Redactor editor in Perch</title>
           <link>https://www.cvwdesign.com/blog/how-to-customise-redactor-editor-in-perch</link>
           <guid>https://www.cvwdesign.com/blog/how-to-customise-redactor-editor-in-perch</guid>
           <description><![CDATA[<p><strong>Update</strong>: 5-3-18. This article was written for Redactor 2017. The Source plugin no longer exists on the Redactor site. I'll find out more&nbsp;and write another post when Perch update their version of the editor.</p>
<hr>
<p><strong>Summary</strong>: Adding a View Source button to Redactor editor in Perch. Customising the editor using other Redactor plugins.
</p>
<p>Perch 3.0 comes with several textarea editors (Redactor, Simple MDE, Markitup) installed by default. It's easy to create a Perch template to use your preferred editor (Redactor in my case). However, you might want to customise the editor, perhaps expanding what it can do by adding more buttons. So, this is what I did to add a View Source button (Redactor Source plugin) to the default Redactor editor in Perch. This can be used with other Redactor plugins too.
</p>
<p>I followed the section "Custom configurations for default editors" on <a href="https://docs.grabaperch.com/api/editors/">this page</a>. Only this section. It's at the end of the page. That's different to the section before it where you are creating a <em>new</em> editor.
</p>
<p>The "Custom configurations" section is how to configure the <em>default</em> editor.
</p>
<ol>
	<li>Add <code>define('PERCH_CUSTOM_EDITOR_CONFIGS', true);</code> to your overall Perch config file.</li>
	<li>Create a <code>config.js</code> file like the example on <a href="https://docs.grabaperch.com/api/editors/">this page</a> (amend as necessary) and put it in <code>addons/plugins/editors/</code></li>
	<li>Download plugins you need from Redactor site, e.g <a href="https://imperavi.com/redactor/plugins/source/">https://imperavi.com/redactor/plugins/source/</a>, and put these in <code>/addons/plugins/editors/redactor-plugins</code></li>
	<li>Test on local dev site. Upload new files to live site.</li>
</ol>
<p>That should be it.
</p>
<p>Login to Perch and admire your new editor functionality :-)
</p>]]></description>
           <pubDate>Tue, 06 Jun 2017 08:54:00 +0000</pubDate>
        </item>
        <item>
           <title>How to display tags in each blog post with Perch</title>
           <link>https://www.cvwdesign.com/blog/how-to-display-tags-in-each-blog-post-with-perch</link>
           <guid>https://www.cvwdesign.com/blog/how-to-display-tags-in-each-blog-post-with-perch</guid>
           <description><![CDATA[<p>I saw this post about <a href="http://forum.grabaperch.com/forum/09-19-2016-show-tags-with-the-posthtml-template">showing post tags in the post.html template</a> on the Perch forum recently. The post explains how to display tags for a blog post in the post's body rather than, for example, in a sidebar.</p>
<p>I've used this method on my <a href="https://www.clivewalker.me">Clive Walker site</a> where I display tags at the top of each post (<a href="https://www.clivewalker.me/blog/2017-04-24-inspirational-parkrun">here</a> for example). So, I thought it might be useful to summarise the code:</p>
<p>At the top of my <code>post.php</code> page (or in a Perch layout), I create a variable called <code>tags_html</code> containing my post's tags (using the <code>perch_blog_post_tags</code> function, described <a href="https://docs.grabaperch.com/functions/blog/perch-blog-post-tags/">here</a>). </p>
<pre>
&lt;?php PerchSystem::set_var('tags_html', perch_blog_post_tags(perch_get('s'), [], true)); ?&gt;
</pre>
<p>In my <code>post.html</code> template, I have this code which displays the tags:
</p>
<pre>
&lt;perch:blog id="tags_html" encode="false" type="hidden" /&gt;
</pre>
<p>It may not be immediately obvious but this uses a modified version of the Perch <code>post_tag_link.html</code> template to display the tags in an unordered list. The modifications are a class on the
<code>&lt;ul&gt;</code> (so that I can use a tag icon background SVG image on the list items in my CSS) and a cleaner post tag URL. Relatively minor changes. </p>
<p>The hidden value means that this tags field is not shown on the post editing screen (there's already a tags field as part of the default Perch functionality).</p>
<p>That's it. I think it's useful to display tags with the post's content so I'm sure I'll be using this again.</p>
<ul><li><em>More info</em>: <a href="https://docs.grabaperch.com/templates/passing-variables-into-templates/">Passing variables into templates with Perch</a></li></ul>
<p><a href="https://docs.grabaperch.com/templates/passing-variables-into-templates/"></a></p>]]></description>
           <pubDate>Tue, 09 May 2017 10:16:00 +0000</pubDate>
        </item>
        <item>
           <title>Did you know you can customise the Perch Admin user interface?</title>
           <link>https://www.cvwdesign.com/blog/did-you-know-you-can-customise-the-perch-admin-user-interface</link>
           <guid>https://www.cvwdesign.com/blog/did-you-know-you-can-customise-the-perch-admin-user-interface</guid>
           <description><![CDATA[<p>This is a guest post by Graham Street from <a href="https://www.streets-ahead.com">Streets Ahead</a>.
</p><hr><p><a href="https://grabaperch.com">Perch CMS</a> provides the ability for you to make simple changes to the Admin interface (Admin UI). I've used it in the past to make the 'help' lines a little bigger, under input fields, for a specific customer. The additional CSS is added via instructions in a well-documented <a href="https://docs.grabaperch.com/api/custom-ui/">page in the Perch documentation</a> and doesn't impact Perch core code.<br>
</p><p>The Perch Team have just released version 3 of Perch and Runway. The Admin UI has had a major change - a completely revised user interface that works much better on mobile devices. I like the new interface, it has some great improvements but only a few of my customers have seen it so far. Those that have like the simpler interface that's great for long pages, because you can 'fold up' (toggle/hide) parts of the region that you're not editing. But both they and I have found it's a little more difficult to visually see the different sections and fields, especially inside more complex regions.
</p><p>I've concluded it is because some of the header backgrounds are very light and perhaps on some screens it's difficult to differentiate between them and the white background. Luckily this is easy to change by simple customisations of the CSS used in the Admin UI.
</p><p>Using <a href="https://docs.grabaperch.com/api/custom-ui/">this page</a> as a guide, this is what I did ...
</p><p>1) Edit <code>/perch/addons/plugins/ui/_config.inc</code> and add this line:
</p><p><code>&lt;link rel="stylesheet" href="/perch/addons/plugins/ui/override_ui.css" /&gt;</code>
</p><p>2) Edit <code>/perch/addons/plugins/ui/override_ui.css</code> and add these CSS lines:
</p><pre>form h2.divider {
    background-color: #eeeeee;
    border-top: 1px solid #aaaaaa;
    font-style: italic;
}
form h3.repeater-heading {
    background-color: #efefef;
    font-style: italic;
    font-size: 90%;
    margin-right: 25px;
}
</pre><p>The first change darkens the clickable fields headers, adds a line above them and adjusts the font. The second change does a similar thing for the repeaters header. Here are a couple of images showing the Perch Admin UI, before and after, on one of our customer's sites.
</p><p>[<em>Click to view larger versions</em>]</p><p><a href="http://www.cvwdesign.com/perch/resources/before-after-1.jpg"><img src="/perch/resources/before-after-1-w1280.jpg" alt="screenshot"></a>
</p><hr><p><a href="http://www.cvwdesign.com/perch/resources/before-after-2.jpg"><img src="/perch/resources/before-after-2-w1280.jpg" alt="screenshot"></a></p><p>At this point I should say that I am NOT a designer. There might be better ways to do this that provide a better user experience, but this has worked for me and my customers. What it does show is how flexible the Perch system is, and how easy it is to make minor changes to it.
</p><p>Graham Street - <a href="https://www.streets-ahead.com/">Streets Ahead</a>
</p>]]></description>
           <pubDate>Thu, 06 Apr 2017 13:33:00 +0000</pubDate>
        </item>
        <item>
           <title>Learning about CSS Grid Layout</title>
           <link>https://www.cvwdesign.com/blog/learning-about-css-grid-layout</link>
           <guid>https://www.cvwdesign.com/blog/learning-about-css-grid-layout</guid>
           <description><![CDATA[<p>There's an exciting new CSS layout method in the latest versions of Google Chrome, Firefox and Opera (see <a href="http://gridbyexample.com/browsers/">browser support</a>). That's <a href="https://www.w3.org/TR/css3-grid-layout/">CSS Grid Layout</a> which promises to revolutionise how we create page layouts. Here are a few links I've collected.
</p><ul>
	<li><a href="http://gridbyexample.com/">Grid By Example</a> is Rachel Andrew's site. It has a wealth of layout examples and video tutorials about Grid Layout.</li>
	<li><a href="http://jensimmons.com/post/feb-27-2017/learn-css-grid">Learn CSS Grid</a> by Jen Simmons has a great list of Grid resources. There are <a href="http://labs.jensimmons.com">Grid demos</a> in the labs section of the site. I like the <a href="http://labs.jensimmons.com/2017/01-009.html">Cards example</a> in particular because it compares different methods.</li>
	<li><a href="https://webkit.org/blog/7434/css-grid-layout-a-new-layout-module-for-the-web/">CSS Grid Layout: A New Layout Module For The Web</a> has a clear explanation.</li>
	<li><a href="https://cm.engineering/getting-to-know-css-grid-layout-818e43ca71a5#.9em21q8dh">Getting to Know Grid Layout</a> is another in depth article that's easy to read.</li>
	<li>Tyler Sticka describes a layout he needed to create in <a href="https://cloudfour.com/thinks/first-css-grid-layout/">Case Study: My First Practical Grid Layout</a>.</li>
	<li><a href="https://14islands.com/blog/2017/03/07/playing-with-CSS-grids/">Playing with CSS Grids</a> describes a lovely magazine-style layout. Nice work.</li>
</ul><p><strong>Update</strong>
</p><ul><li><a href="https://alistapart.com/article/practical-grid">Practical CSS Grid: Adding Grid to an Existing Design</a>: Eric Meyer describes how he converted his site to use Grid Layout. It looks very easy!</li><li>Rachel Andrew describes <a href="https://rachelandrew.co.uk/css/cheatsheets/grid-fallbacks">Grid “fallbacks” and overrides</a> and explains that as soon as an item is defined as a grid item, other CSS you might have used, for example floats for layout, gets overwritten. Outside that scenario, <a href="https://hacks.mozilla.org/2016/08/using-feature-queries-in-css/">feature queries</a> are simple to implement and widely supported.</li><li>Here's a fun site. Learn Grid Layout with <a href="http://cssgridgarden.com">Grid Garden</a>.</li></ul><p><strong>Update 2</strong></p><ul><li><em>Video</em>: Rachel Andrew <a href="https://youtu.be/tjHOLtouElA">explains Grid Layout</a> at Render 2017.</li><li><em>Video</em>: Jen Simmons <a href="https://youtu.be/16enLRDbOyY">demonstrates Firefox Grid Inspector tool</a> with some grid layout image gallery examples.</li></ul><p><a href="https://rachelandrew.co.uk/css/cheatsheets/grid-fallbacks"></a></p><hr><p>I'll update this post when I come across more great links about Grid Layout.
</p>]]></description>
           <pubDate>Thu, 23 Mar 2017 12:51:00 +0000</pubDate>
        </item>
        <item>
           <title>How to edit forms in Perch CMS</title>
           <link>https://www.cvwdesign.com/blog/how-to-edit-forms-in-perch-cms</link>
           <guid>https://www.cvwdesign.com/blog/how-to-edit-forms-in-perch-cms</guid>
           <description><![CDATA[<p>How can I enable a client to edit form fields via the admin area of Perch CMS? This cannot be achieved dynamically (where you pull in some content from another area of the site) but you can add <em>some</em> editability to a form's <code>select</code> input element using the following code. Here, I want the client to be able to edit the Subject input of their Contact form.
</p><pre>&lt;perch:label for="subject"&gt;Subject&lt;/perch:label&gt;
&lt;perch:input type="select" id="subject" options="&lt;perch:content id="subjectoptions" type="text" label="Subject" help="Add subjects separated by commas" /&gt;" /&gt;
</pre>]]></description>
           <pubDate>Wed, 07 Dec 2016 09:07:00 +0000</pubDate>
        </item>
    </channel>
</rss>