DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
11 Monitoring and Observability Tools for 2023
Learn more
  1. DZone
  2. Coding
  3. Languages
  4. HTML5 'article' tag: On syndication and content types

HTML5 'article' tag: On syndication and content types

Niels Matthijs user avatar by
Niels Matthijs
·
Nov. 03, 11 · Interview
Like (0)
Save
Tweet
Share
5.92K Views

Join the DZone community and get the full member experience.

Join For Free
ever since the article tag was introduced in html5 i've been struggling with a way to wrap my head around its practical implications. i've written about the difference between section and article before, but this time i'll keep a more rigid focus on the article element itself and how to approach it when writing html code. as the current definition leaves too much room for doubt and misinterpretation, we need something more tangible to guide us along.

what changed since last time

a lot has been written about the article element already, but many of these posts are based on an older definition of the html5 article. the definition received a small (yet important) update not too along ago, making it at least a little more relevant for everyday use. here's the definition i quoted last time (and which can be found in most articles google turns up when searching for html5 article info):

quote the article element represents a component of a page that consists of a self-contained composition in a document, page, application, or site and that is intended to be independently distributable or reusable, e.g. in syndication. unquote

source: html5 doctor



if you check the w3c or whatwg site now though, you'll come across the current version:

quote the article element represents a self-contained composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g. in syndication. unquote

source: w3c

the big difference? well, the article element went from something that is intended for syndication to in principle, syndicatable . it may sound like a minor change in phrasing, but it means that we can now use the article element for content that is not actually being syndicated, but could be (in principle). with the first definition, you'd be (at least, in theory) forced to change the html code of your site if it was suddenly decided a particular piece of code was not syndicatable anymore (as in, we'll stop the rss feed of our event data). rather that describe content that is syndicated, the article element is now used for content that could be syndicated.

on syndication

i am somewhat bothered though by the introduction of a term like "syndication" in the html spec. syndication is a description that is neither semantic nor structural, so it feels pretty much out of place in there. furthermore, as a content owner and believer in the semantic web, i don't really care what part of my content is syndicatable. as long as i am properly quoted, crawlers can pass by and scrape whatever piece of content they want. they want to include my main navigation in their site? sure, why not. want to get my rss links? just take 'em. building a front-end newsletter form aggregation site? go ahead, crawl my site and take whatever you see fit.

on top of that, i'm not planning to ask myself whether there is a possible scenario for syndication each and every time i write a div or section. i'd be going insane as most of the time i could probably come up with some obscure reason why someone would still want to syndicate that particular part of his site. also note that the definition of syndication is broader than "it can appear in an rss feed". it's practically every situation where you as a site owner would like to offer a piece of your code to an external source.

one final (and important) remark about syndication is that it is just cited as an example in the current definition. the e.g. list is not exhaustive, meaning syndication is just one example of many. when talking about the article element people often refer to syndication (and rss feeds) though, but the real focus lies on "independently distributable or reusable".

on self-contained

note that the current definition also holds two separate requirements for using the article element. independently distributable or reusable is just one part of the definition, your piece of code should also be self-containing. again your mileage may vary and people will hold different meanings to this part of the definition.

the most popular example to illustrate this vagueness is the wrapping of a blog comment in a separate article tag. while it is not uncommon to offer comments through an rss feed, the question remains whether a comment is really self-contained. nobody doubts that a comment can exist by itself and holds all the data to properly define itself, the real question is whether it has any dependable value outside of its immediate context. distributing a comment without any of the other comments doesn't always make sense, especially when the commenter didn't bother to quote previous comments to which he is reacting. it becomes just another random blob of text, not that much different from a simple paragraph.

again it's a tricky issue which can probably fuel days of discussion, only leading me to believe that it's probably not all that fit for defining the proper use of the article element.

abstraction: on content types

taking one step back, let's see if we can figure out why people felt the need to create an article element in the first place. this is just second-guessing of course, but it might help us to get a little closer to the core purpose of this new tag. syndication probably wasn't the incentive, i think meta data/concepts like that would probably be better fit as an attribute rather than a separate tag. and for sectioning pages the spec already lists the section tag.

straying away from edge cases and fuzzy definitions for a minute, we'll find some proper and indisputable use for the article element when marking up data like news, events, products, reviews, contacts ... and yeah, even comments. people with a little understanding of cmses like drupal will recognize these elements as content types . content types are a way of describing and entering structured data, displaying that data in different views (shortlist - overview list with filters - detail) all across a site.

if you keep to this perspective, all of a sudden the use cases for the article element become a lot clearer. content type instances are typically self-contained, make sense as syndicated content and are definitely reusable (on your own site as well as on someone else's). the only difference with the current definition is that you probably lose some obscure edge cases (like a newsletter subscription box) in the process.

conclusion

so even though using the article element for content types might exclude a couple of valid use cases when held against the standing definition, the clarity it brings makes it a lot easier to help you decide whether to use the article tag or just stick with a section/div.

that said, it somehow feels as if the content type approach lies closer to the original intentions of the article tag, which were then somehow clouded by a definition that's way too fuzzy. it could be my personal interpretation of course, but for now i'll stick to using the article element for content type instances exclusively, and suggest you do the same until the next article spec update.

source: http://www.onderhond.com/blog/work/html5-article-element-content-types

HTML code style Element

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 5 Software Developer Competencies: How To Recognize a Good Programmer
  • 10 Easy Steps To Start Using Git and GitHub
  • Test Design Guidelines for Your CI/CD Pipeline
  • Using GPT-3 in Our Applications

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: