- Issue created by @mcortes19
- 🇦🇺Australia almunnings Melbourne, 🇦🇺
Took a quick look today.
Things to note:- It's not really a metatag, it's a script tag with a JSON value, built using metatags
- It's only injected on page views via
schema_metatag_page_attachments_alter
- The schema results can have breadcrumbs via current_route_match, which will need to resolve in a subrequest, which in turn needs the URL of the entity and fires off extra queries.
To execute it in a subrequest, it'll need the
SubrequestBuffer
which is a part ofgraphql_compose_routes
So we have a few choices:
- Do support breadcrumbs and add the schema LD data via the route() InternalEntity
- Do support breadcrumbs via entity canonical URL and add to every entity
- Don't support breadcrumbs on the schema
And just spitballin' some ideas here:
1. Putting scripts on the
RouteInternal
feels a bit weird and detached.2. I'd prefer to keep the ability to execute a
SubrequestBuffer
low, it's not an excellent way of doing things. So adding it to every entities metatag prop might allow attacking the schema.3. Doable now if we add it to the metatag as something like MetaTagScript and I massage some data around.
So I'm leaning towards option 3, and stripping out any breadcrumbs from the entity.
Option 2 is bad juju
Option 1 is a backup plan to be explored.Thoughts?
- Status changed to Postponed: needs info
11 months ago 10:20am 27 January 2024 - 🇨🇷Costa Rica mcortes19
@almunnings yes, I will explore option 3 to expose it as MetaTagScript
- Status changed to Active
9 months ago 10:15am 9 April 2024 - Status changed to Needs review
9 months ago 12:11pm 9 April 2024 - 🇦🇺Australia almunnings Melbourne, 🇦🇺
Hows this...
node(id: "...") { ... on MetaTagInterface { metatag { ... on MetaTagScript { tag content attributes { type } } } } }
<tag {...attributes}>content</tag>
<script type="application/ld+json">...</script>
I've not added any special work around breadcrumbs. I don't really want to enable a subrequest per entity. I don't think thats especially sane. Unsure what to do with that.
- Status changed to Fixed
9 months ago 1:19pm 11 April 2024 - 🇦🇺Australia almunnings Melbourne, 🇦🇺
Merged into dev. Prepping for beta2.
Thanks!
- Status changed to Fixed
9 months ago 11:10pm 11 April 2024