Skip to content

Extending ImageMedia #18

@andrewmarkham

Description

@andrewmarkham

Hi @remkoj

I am using the code from the 'redesign' branch, so I appreciate that this is still being worked on.

I have extended the type 'ImageMedia' to include a new 'AltText' property to support SEO and Accessibility.

The following query works

query MyQuery {
   ImageMedia {
    items {
      Title
      _metadata {
        displayName
        url {
          type
          hierarchical
          default
          base
        }
      }
    }
  }
}

...but when I place the image directly into a content area the new 'Title' property isn't returned. The fragments in the 'getContentByPath' query don't support the extra property when the items are expanded.

If I take the generated 'getContentByPath', amend it as shown below then it works.

fragment BlockData on IContent {
  ...IContentData
  ...HeroWithImageBlockData
  ...TextBlockData
  ...ImageMediaData // added this new fragment
}

fragment ImageMediaData on ImageMedia {
    Title
    _metadata {
        displayName
        url {
            ...LinkData
        }
  }
}

I think we should be able to extend the built in Image and Video models to support these common properties.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions