Skip to main content
drupalreleases
Release: Drupal 11.4.9 — Update released for Drupal core (11.4.9)! Release: Better Exposed Filters 7.2.0 — Minor update available for module better_exposed_filters (7.2.0). Release: Bootstrap 8.x-3.43 — Minor update available for theme bootstrap (8.x-3.43). Release: Svg Image 3.2.5 — Minor update available for module svg_image (3.2.5). Release: Book 3.0.8 — Minor update available for module book (3.0.8). Release: Tagify 2.0.5 — Minor update available for module tagify (2.0.5). Release: Editoria11y Accessibility Checker 3.0.11 — Minor update available for module editoria11y (3.0.11). Release: Events Log Track 5.0.1 — Minor update available for module events_log_track (5.0.1). Module Revived: @font-your-face 4.3.0 — Module fontyourface updated after 7 months of inactivity (4.3.0). Security Coverage: Open Y Branch Selector — Module openy_branch_selector now has official Drupal security advisory coverage.

Schema.org Metatag Token Types

No security coverage

Part of the Schema ecosystem · 23 projects

View on drupal.org

This module allows the Schema.org Metatag module to use tokens for the Schema.org type field. Instead of selecting a type from a dropdown, you can use tokens to dynamically pull the type from your content's data, simplifying management for directories or sites with varied content types. This ensures more accurate and easily maintained structured data.

Schema.org Metatag adds structured data to your site so search engines and AI assistants can understand what each page is about. Part of that is saying what kind of thing the page describes. A vet clinic, a hotel, a school.

You choose that from a dropdown built out of the Schema.org type tree, which is thousands of entries deep.

For most sites that is fine. You set it once for the content type and you are done, because every page really is the same kind of thing.

It falls apart on a directory. A groomer is not a vet, and a vet is not a hotel, so no single answer is right for all of them. You can add a Metatag field to the content type and let somebody override the type per listing, and that does work, but it means a human hunting through the Schema.org tree every time a listing is added. On a directory of any size that is not realistic, and it goes wrong quietly when somebody picks the nearest thing rather than the right thing.

This module lets that field take a token, so the type comes from your own data instead of from somebody's memory.

Features

  • Turns top-level Schema.org type fields from a dropdown into a text field that accepts a token.
  • The full Schema.org type list is still there as you type, so choosing a fixed type works exactly as it did.
  • The type can be maintained once per category, rather than chosen again on every listing.
  • No hunting through the Schema.org tree per item, and no drift as content is added by different people.
  • Nothing changes on the output side. Metatag already swaps tokens for real values before a page renders.

Post-Installation

There is no configuration screen and nothing to switch on.

Once enabled, the affected Schema.org Metatag fields appear as text fields with Schema.org suggestions. Edit them where you already edit your Metatag settings, either the Metatag defaults or the Metatag fields on a piece of content, and enter either a Schema.org type or a token.

A worked example. Add a plain text field to your category vocabulary called field_schema_type and give each category its Schema.org type. Then set additionalType to:

[node:field_category:entity:field_schema_type]

Every listing now declares its own type, and you maintain the list once per category instead of once per page.

Additional Requirements

  • Token, for browsing the tokens available on your content

Similar projects

There is no other module doing this. The Schema.org Metatag and Metatag issue queues have an old request for the additionalType tag itself, and one asking about schemas per content type, but nothing asking for token support on the type selects.

There is a manual way to get the same result. Adding a Metatag field to a content type lets each piece of content override its schema group, including the type. That works, and for a handful of pages it may be all you need.

The difference is where the answer lives. Doing it by hand means somebody picks from the whole Schema.org tree on every single page. This module lets the type come from your own data, so it is maintained once per category rather than once per page, and it cannot drift as content is added.

Things worth knowing

  • Only top-level type fields change. Nested type fields inside more complex Schema.org Metatag properties are left alone.
  • An empty token removes the property. If a token does not resolve, the property is left out rather than rendered blank. For the main type field that produces incomplete structured data, so either leave a fixed type in the field or use Metatag's fallback chain, [node:field_one|node:field_two].
  • A field with several values uses the first one. Content in three categories takes the type of the first.
  • Uninstalling is safe. The fields go back to being dropdowns. Fixed types are still selected. Anything that was a token no longer matches an option, so re-save those fields before relying on them.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Aug 2026
Latest release
1 month ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.0.x-dev Dev 10–11 Aug 25, 2026