What is the jmix:seoHtmlHead mixin and what does it provide?
Question
What is the jmix:seoHtmlHead mixin and what does it provide?
Answer
jmix:seoHtmlHead is a mixin shipped by the site-settings-seo module. It adds
two SEO fields to pages and to content marked as the main resource.
Its definition:
[jmix:seoHtmlHead] mixin
extends = jnt:page, jmix:mainResource
- seoKeywords (string, tag[autocomplete=10,separator=',']) i18n facetable multiple < '.{0,255}'
- openGraphImage (weakreference, picker[type='image']) < 'jmix:image'
| Property | Type | Notes |
|---|---|---|
seoKeywords | string, multiple | Internationalized, so keywords are per language. Edited with a tag picker, facetable, each value at most 255 characters. |
openGraphImage | weakreference | A single reference to a jmix:image node. Not internationalized, so one image is shared by every language. |
You do not apply it yourself
The extends = jnt:page, jmix:mainResource clause means Jahia offers the mixin
automatically on every page and on any content type that is a main resource. It
appears as an option in Content Editor rather than something you declare in your
own definitions.
"I filled in seoKeywords but no meta keywords tag appears in the HTML"
That is expected, and the module is not broken. Setting seoKeywords or
openGraphImage changes nothing in the delivered page on its own - no
<meta name="keywords"> and no og:image tag is emitted just because the fields
have values.
Look at your site template, not at the module. See below.
It stores the values, it does not render them
This is the part that surprises people. The mixin only holds the data. No view
and no filter in Jahia's public repositories reads seoKeywords or
openGraphImage, so filling these fields does not change the delivered HTML on
its own - the site template is responsible for emitting the corresponding
<meta name="keywords"> and og:image tags.
If you set the fields and nothing appears in the page source, the template is where to look, not the mixin.
Verified
On Jahia 8.2.3.2, jcr.nodeTypeByName(name: "jmix:seoHtmlHead") returns
mixin: true, abstract: false, queryable: true, and exactly the two
properties above.
This article was drafted with AI assistance, then reviewed and curated by Jahia Customer Support engineers before publication.