Problem/Motivation
Some field values, such as "sameAs" and "awards" accepts multiple values as an array.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"image": "https://www.example.com/example_image.jpg",
"url": "https://www.example.com",
"sameAs": ["https://example.net/profile/example1234", "https://example.org/example1234"],
"logo": "https://www.example.com/images/logo.png",
"name": "Example Corporation",
"description": "The example corporation is well-known for producing high-quality widgets",
"email": "contact@example.com",
"telephone": "+47-99-999-9999",
"address": {
"@type": "PostalAddress",
"streetAddress": "Rue Improbable 99",
"addressLocality": "Paris",
"addressCountry": "FR",
"addressRegion": "Ile-de-France",
"postalCode": "75001"
},
"vatID": "FR12345678901",
"iso6523Code": "0199:724500PMK2A2M1SQQ228"
}
</script>
Source: https://developers.google.com/search/docs/appearance/structured-data/org...
Steps to reproduce
For example, in Organization, add the "sameAs" field. It's only possible to fill with a single text value.
Proposed resolution
Create the multiple value field type, enabling the format like:
"sameAs": ["https://example.net/profile/example1234", "https://example.org/example1234"]
This field type must be available for sameAs and awards.
Possibly, other schema types may have the same need.
Comments
Comment #2
nataliaalves commentedComment #4
daniel_mm02 commentedComment #6
daniel_mm02 commentedHi, I have created a MR: https://git.drupalcode.org/project/json_ld_schema_ui/-/merge_requests/13 which needs revision to merge it, I have tested it and now if you mark the new chockbox in the form and separate the values with commas the result will be as follows:
Input: test1, test2, test3 test4 test5, test6
With checkbox marked:
<script type="application/ld+json">{"@context":"https:\/\/schema.org\/","@type":"Organization","awards":["test1","test2","test3 test4 test5","test6"]}</script>With checkbox unmarked:
<script type="application/ld+json">{"@context":"https:\/\/schema.org\/","@type":"Organization","awards":"test1, test2, test3 test4 test5, test6"}</script>Comment #7
daniel_mm02 commentedComment #8
gxleano commentedComment #9
gxleano commentedComment #11
gxleano commented