Automating the display

With all the content migrated into our content model, we could begin plugging it into layout files. But of course, the beauty of structured data is that you can use it in more than one place. So the introductory text from one content piece could appear on one page, the body and images on another.

Best of all, by relying on metadata, database queries, and little code fragment magic, we can automate the display so that when you add a new content piece, multiple pieces of multiple pages get updated all at the same time.

In our Volunteer Spotlight, for example, parts of a single content piece populate a list of spotlights, the spotlight page itself, and a spotlight widget in the left navigation for the entire website section. I created code fragments in the content management system that update list, spotlight, and widget automatically when we add a new spotlight.


One content piece

  

Multiple uses

 
   

  A list of spotlights

  The spotlight itself

  The spotlight widget