I've noticed that the article tag contains a header tag that is only displayed when the view not a page. I'm guessing this is for teaser views? Or perhaps more blog style pages where multiple nodes are rendered on 1 page...
My problem is that when in page mode showing the single node (node/%) then shouldn't the article still output the header ? I know there is an H1 tag on the page and the article is article > header > h2:title.
Is this a semantic issue or it doesn't really matter? My use case is placing some node meta content before the title which means in my case disabling the page title.
Comments
Comment #1
johnalbinNo, the proper way is to put the title inside the <article> tag, but Drupal 7 puts the page title in the page.tpl while the node content remains in node.tpl.
There's no clean way to do this in D7. And there's no fix for this in D8 either. :-\
Comment #2
danny englanderI've been pondering over this issue on and off for a while now, it's been nagging me in the back of my mind. I noticed that sites that have an
<h1>tag within the<article> tagdisplay better for example when you copy and paste a node URL into a Linkedin Status. I tested this out with lots of different sites and in every case when the<h1>appears before the opening<article>tag, the staus was not picked up too well.I tested out some code within a Zen subtheme I am developing and this is what I did:
<h1>anywhere it's not a node:<h1>tag to the existing code that comes after the<article>tagI tested this with a variety of pages and views and in each case the page title rendered only once and now within nodes, it's just after the
<article>tag. I suppose one could argue that this has better SEO as well as semantic value. If anyone is interested, I could roll it into a patch but I am not really sure if what I am doing is correct or using good logic. My guess is that it needs a lot more testing and refinement and I am not even sure if my preprocess function is the best one that could be used. I'd be interested in hearing what the downsides of this are.Comment #3
danny englanderAfter more research and experimentation, this may not be as an important issue as I thought. I kind of went down this road but in reality, what I was probably looking for was better Open Graph Meta data for content sharing so I probably need: http://drupal.org/project/opengraph_meta.
Comment #4
johnalbinMarking this as "can't fix". :-p Good luck!