Skip to main content
January 24, 2017

Avoid self-definition in taxonomy term description when using the Onomasticon module

by Richard Papp

The Drupal 8 module Onomasticon provides a text filter to automatically display the definition of taxonomy terms everywhere a term of a designated vocabulary is used. However, you may want to avoid self-definition on the term's own page as its description is already visible without it. You can achieve that by marking up the taxonomy term in its own description with the dfn HTML element.

When you enable the Onomasticon filter on a text format you can disable tags. The module won't add definitions to taxonomy terms wrapped in disabled tags. By default the dfn element is among the disabled tags.

The <dfn> element represents the defining instance of a term. The paragraph, description list group, or section that is the nearest ancestor of the <dfn> element must also contain the definition(s) for the term given by the <dfn> element. - HTML 5.1 W3C Recommendation

The dfn element may contain no more than the exact term being defined. Hence marking up taxonomy terms on their own term page complies with the HTML standard. You can avoid self-definition by the Onomasticon filter while displaying definitions for other terms within the same text.

Tags

Tools

Add new comment

Klartext

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
CAPTCHA