Problem/Motivation

A common scenario with SEO output is to have a media field on a node and want to display the URL of the image in the meta data. It's unclear how to do this with Schemaorg Blueprints.

Proposed resolution

Work out the minimum requirements to output the URL of an image from a media item that's added on a field on a content type as a data item.
Add the steps to the documentation as a HOWTO item.

Remaining tasks

Work out the minimum requirements to output the URL of an image from a media item that's added on a field on a content type as a data item.
Add the steps to the documentation as a HOWTO item.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

So I can add these to the JSON-LD output like this:

    "image": "[node:field_top_image:entity:image:hero_image:url:absolute]",

In this case "field_top_image" is an entity reference field, "image" is the field for the image file on the media object as identified on the Image media type's field specifications, and "hero_image" is the image style that's used to render the image.

So the question is - can this output be easily output by customizing the UI?

jrockowitz’s picture

We could add a setting to output certain media types as the URL to the source and not a full https://schema.org/MediaObject

jrockowitz’s picture

We could enhance "Schema.org type entity references display" (https://schemadotorg.ddev.site/admin/structure/media/manage/image/fields) token. media--image: "[media:image:url:absolute]",

Generally, I think people will decide to include the image's ImageObject or the image's URI sitewide.

jrockowitz’s picture

Status: Active » Needs work

We might be able to adjust to 'schema_type_entity_references_display' to 'media--image' to be the image's url.

jrockowitz’s picture

I think we could support something like

schema_type_entity_references_display:
  block_content: entity
  paragraph--layout: none
  paragraph: entity
  media--ImageObject: '[media:field_media_image:entity:url]'
  media: entity
  Intangible: entity
  node--Thing: URL
jrockowitz’s picture

Status: Needs work » Needs review

  • jrockowitz committed 3e21567c on 1.0.x
    Issue #3407113: Minimum steps to output image media reference field as a...
jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.