I’m curious how you all lovely people would tackle something like this!
I’ve got a “global” snippet that I aim to use for each of the page headers into which I pass whatever title I want to display, such as:
<?php snippet('global/page.header', ['title' => $page->title()]) ?>
The above works perfectly. Now I’m tinkering with adding a subtitle/tagline/thing but the markup for that would depend on the template.
<?php snippet('global/page.header', ['title' => $page->title()], 'subtitle' => $someVariable) ?>
As an example, for blogposts specifically I’d like to output a
time element and fill the
datetime attribute as well as a formatted displayed date, i.e:
And as another example, on other pages it would simple be a
p tag or similar:
<p>Some cool text</p>
What would be the best approach here? If statements in the
The site I’m building is very simple and straight forward and the easiest way would probably be to omit the snippet and just build the header manually for the blogposts in this case. But I’m curious how you would approach and solve something this!