Make everything editable

I always try to avoid the temptation to leave hard-coded text strings in page templates.

Even if the text seems unlikely to require editing, this is invariably the first thing that a CMS user will want to amend.

Save yourself a source code amend and redeployment by making all text editable (unless the page really depends on a specific text string to make sense), and adding sensible defaults for required fields.

Everyone wins

CMS editors and clients really don't want to pay for a small text update, so unless you want to make a code change and deployment for free, one of you is likely to feel out of pocket.

If you've anticipated that the CMS editor may want to change the text at some point in the future, then the system is already set up to handle that change, and your client is happy that they don't need a developer to update a line of copy or a button label.

Here's an example from a search module:

search_label = models.CharField(
    max_length=255,
    verbose_name='Label',
    default='Search',
)

The default for this label is "Search", but the editor may wish to change this to something like "Search the site" or similar.

As this is an editable field (which is also making use of verbose labels), then this can be done in seconds by the CMS editor, no one gets hurt, and everyone is happy.

Nice and simple

Making the field required means that there's no extra logic required in the template to verify the existence of the text, as the page can't be saved without it.

And because the field has a default, it'll be pre-populated on initial save when developing, or when creating a new instance by the CMS editor.

This post is part of a series: UX for the CMS user