On content heavy sites, it can be useful to inject snippets of code into CMS data before display (for example, into the body copy of an article). These snippets could be automatically generated glossaries, tables of contents, or ad units, placed mid-content.
Let's explore a general approach to getting such snippets into place.
Object states are used in many ways in eZ Publish, from workflows to menu management to controlling SEO tags. In eZ Publish 5, object state information is not available by default as one of the intrinsic attributes of a content or location object. In this post, we will show you how to access object states in PHP (usually in your custom controllers) or in Twig templates.