brotkrueml / schema

TYPO3 extension providing an API and view helpers for schema.org markup
https://extensions.typo3.org/extension/schema
GNU General Public License v2.0
32 stars 9 forks source link

Reference types via id only in Fluid templates #85

Closed brotkrueml closed 2 years ago

brotkrueml commented 2 years ago

As an integrator I want the possibility to reference types in Fluid templates.

Example in JSON-LD

[{
  "@type": "BlogPosting",
  "name": "Some title",
  "author": {
     "@id": "authorid"
  }
}, {
  "@type": "Person",
  "@id": "authorid",
  "name": "Arthur Dent",
}]

Example in Fluid

This does not work currently:

<schema:type.blogPosting name="Some posting">
    <schema:property -as="author" -id="someauthor"/>
</schema:type.blogPosting>
<schema:type.person -id="someauthor" name="Arthur Dent">

Error:

Required argument "value" was not supplied.

Acceptance criteria

brotkrueml commented 2 years ago

Okay, have to read my documentation. This is possible by now with node identifiers:

<schema:type.blogPosting
    name="42"
    author="{schema:nodeIdentifier(id: 'https://example.org/#arthur-dent')}"
/>

<schema:type.person
    -id="https://example.org/#arthur-dent"
    givenName="Arthur"
    familyName="Dent"
/>

See docs: https://docs.typo3.org/p/brotkrueml/schema/2.2/en-us/Developer/ViewHelpers.html#schema-nodeidentifier-view-helper