4

I want to fetch all the Image Components inside a Publication from DXD. I am using the below Query which gives me all the Components(Topics) inside a Publication but I want just Images.

Any idea of how to filter the Images from all the components in the result?

{
  items(
    filter: {
      itemTypes:[COMPONENT]
      namespaceIds: [2]
    publicationIds:[8915]
    }
  ) {
    edges {
      node {
        itemId
        title
      }
    }
  }
}
5

Try adding a customMeta under the filter section:

customMeta: { key: "ishtype.object.value", value: "ISHIllustration" }

You may also be able to do this in code, using the Public Content API (PCA) client. Something like this:

var client = ApiClientFactory.Instance.CreateClient();

InputComponentPresentationFilter inputFilter = new InputComponentPresentationFilter();
inputFilter.CustomMeta.Key = "ishtype.object.value";
inputFilter.CustomMeta.Value = "ISHIllustration";
inputFilter.CustomMeta.ValueType = CustomMetaValueType.STRING;

var imageComponents = client.GetComponentPresentations(ContentNamespace.Docs,
                                                       pubId,
                                                       inputFilter,
                                                       new Pagination(),
                                                       null, null, null);
| improve this answer | |
2

Saurabh - I believe you can filter on schema ID or Title too?

schema: { title: SCHEMA_TITLE }

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.