Maintaining Content With Snippets
On the adventure of reworking wayne.edu, we started to notice a common trend: Simple data— like the number of degree programs offered, for example — is different across our websites. How do we know which one is correct? Who is responsible for maintaining that? Should it be reviewed every month?
Welcome Content Snippets. Maintaining variable content on the web can seem daunting. Making sure your content is up to date is crucial for the end-user. Rolaine recently made a post about this concept, but I’d like to take some time and explain how we plan to implement content snippets from a developers perspective.
Instead of allowing users to only add pages in our CMS, we are going to develop a new section which allows them to add snippets of information. A snippet offers the following:
- Having an HTML Editor so the content can be rich if necessary.
- Tagging content snippets so we can search against them.
- A scope which allows us to have snippets that are available across every website (global) and ones that are only available to the site you are working on.
- Having a review date so the content can be looked at on a recurring basis (We may also assign a snippet to a user).
- Embed code which can be copy/pasted to a CMS page to be used.
While adding or editing a CMS page, we are going to showcase the snippets so they can be dragged directly into the editor. On the backend, the following will occur:
- When a page is saved, it will look up all the snippets and compile them as static html that is written to the page. We don’t want this to slow down page loads by having to do queries on the fly.
- When a snippet is edited in the CMS, it will find all the pages that use that snippet and recompile the page.
While this seems like such a simple idea, we feel it is going to be very powerful and ultimately change the way we maintain our content. I read a great quote recently that is relative to this:
“Great design is so obvious when you see it, but takes time and talent to discover it.” - Anonymous