When building websites and adding content for our Magento 2 clients a question we constantly have to ask ourselves is, “Does the client want to change this themselves?”.
On the surface a client might argue that having everything available for them to edit would be preferable, however there are a few downsides to this:
- Making every single part of a site accessible through the Magento CMS will take a lot more development time. I’m not sure by exactly how much, but I would say it could easily double, if not triple the total turnaround for the project.
- Having everything accessible through a CMS gives more scope for things to break. Leaving broken markup (non-valid HTML) in a CMS block has the potential to completely break a page for customers from the moment the block is saved. If you have 20 CMS blocks on a single view with multiple users making changes, it can be extremely difficult and time-consuming to work out where an issue may have arisen.
- CMS blocks don’t have a perfectly intuitive way to be identified. Having a CMS block named “Top banner notification” seems reasonably self-explanatory, but the more CMS blocks that are added the more descriptive the naming has to be. This can lead to convoluted naming such as “Top Homepage Grid Top Second Item” or “Top Homepage Grid Third Row Second Item” etc, and can quickly grow into something much more difficult to manage.
Somewhere along the way a developer will have to make this decision by weighing up the added benefit of making something editable though the CMS against the added cost, as deliberating over each of these decisions could potentially add more delay than the implementation itself.
So what do we do?
In most cases the answer will be a straightforward YES or NO.
If you’re creating a notification banner to allow your client to keep customers up to date (for example displaying their delivery schedule over the Christmas holidays) it seems reasonable to assume they would want 100% control over this content. Not having to ask a developer to update this content when needed gives them control over what is displayed, when it is changed and how frequently
If you’re building a newsletter sign-up modal, deciding if the client will want to be able to update the label on the email input the answer is most likely NO. This level of CMSifying will quickly lead you into the issues outlined above
This isn’t to say however that there won't be some less-obvious scenarios. Here at Develo we tend to apply some simple processes to attempt to minimise the additional costs passed on to clients whilst giving them access to edit as much content as is reasonable. Below are some of the approaches we take:
- Minimise the amount of HTML. Some clients will have people in charge of content who have a great understanding of HTML, others less so. Where the underlying functionality will not need to be updated we will always try to abstract the editable text from the markup itself. Creating the required markup in a template file and then rendering the more minimal Magento CMS content within it. The client is then free to update the content themselves whilst minimising the possibility to break any markup and subsequent styles.
- Use widgets where possible. For our more recent clients when we know they will want to be able to edit links, titles, subtitles, content and images within a specific section of the site, we’ve found that creating custom widgets is the best way to go. In the admin a client is able to specify multiple fields for all of the above. We then render a template which pulls through these values and applies them exactly as required. This is a really great way to abstract more complicated sections of a site, minimising the potential for issues and the number of CMS blocks that need creating whilst giving clients 100% control over the content itself.
- Use your head. The third and most important is to just use your head. If you understand the project you are working on it can be easy to realise when you’re heading towards a “Second From Left Bottom Grid Mobile Button Text” scenario and to start thinking about a more appropriate solution. Knowing your client is also key. If you know a client has a department responsible for content and they are confident with HTML it may be reasonable to render more substantial blocks of code through the CMS system.
For more information on the custom widgets module mentioned above check out my next blog post where I will go through how to set this up and start improving how you let clients keep their content up to date.