Sometimes you want to make sure an element, such as a JavaScript file, is shared in the header of your HTML document. concrete5 allows you to inject any element, such as a JavaScript or a CSS file, into the head of your HTML document from your block or package controller.
Remember the content block template we created in Chapter 6, Customizing Block Layouts to enhance the custom tooltips with a more stylish version? The template works nicely, but it only works if you change the custom template for every content block where you want this tooltip to appear. Now, let's say you forget to change the template on one page. Nothing would be broken, but the look and feel of your website wouldn't be consistent, something we'd like to avoid.
What options are there?
We could create a block for this which would use the content of the whole page. This means that you wouldn't have to modify every content block but you'd still have to place that block...