0
{
    typedComponent(namespaceId: 1, publicationId: , 8,componentId: 52117) {
        title
   ... on DownloadCenterAdvert{
            title
    
    
          image{
                
                ... on Image{
                    variants{
                        edges{
                            node{
                                url
                            }
                        }
                    }
                }
            }
            link{
                text{
                    html
                }
                url
                target
            }
        }
    }
}

Output Should Render like Below,

{
    "data": {
        "typedComponent": {
            "title": "Advert",
            "image": {
                "variants": {
                    "edges": [
                        {
                            "node": {
                                "url": "/images/support/DownloadCenter/US106-42090.jpg"
                            }
                        }
                    ]
                }
            },
            "link": {
                "text": {
                    "html": "Download Center Help"
                },
                "url": "http://www.example.com",
                "target": "_blank"
            }
        }
    }
}

But its image not resolving its giving "/images/US106-42090.jpg" instated of "/images/support/DownloadCenter/US106-42090.jpg" as below any suggestion to resolve this

{
    "data": {
        "typedComponent": {
            "title": "Advert",
            "image": {
                "variants": {
                    "edges": [
                        {
                            "node": {
                                **"url": "/images/US106-42090.jpg"**
                            }
                        }
                    ]
                }
            },
            "link": {
                "text": {
                    "html": "Download Center Help"
                },
                "url": "http://www.example.com",
                "target": "_blank"
            }
        }
    }
}
1
  • Welcome to Tridion Stack Exchange! By default, linked images or other binaries, are published to the "images" setting for a Publication. They're automatically added to the published package when the linking Components are queued. Do you get the relative folder paths when publishing the images on their own? Commented Jan 4 at 15:53

1 Answer 1

0

Thank you for detailing the issue you're encountering with image path resolution in GraphQL 9.6. It seems that the image URL is not being constructed as expected, showing /images/US106-42090.jpg instead of the desired /images/support/DownloadCenter/US106-42090.jpg. This behavior is likely influenced by the configuration of publication properties and server-side logic during the publishing process.

In Tridion Sites, the binary path construction is tied to the publication properties, specifically the 'Images URL.' if you want to change the Image relative path then it requires customization on the CM side.

It's important to note that GraphQL queries fetch data from the database, but the intricacies of URL construction may not be directly controlled by these queries. Customizations in TBBs and CM side resolving logic often play a crucial role.

I hope it helps you to understand.

2
  • Binaries indeed publish to the "/images" path in Content Delivery as the default behavior. A common approach was to use Component Template logic (with a C# Template Building Block) to change the location of images. But the "templateless" data pipeline automatically adds images to the publishing package. So is it still possible to change the path of images during publishing? Either way, I think getting the folder paths over the (GraphQL) Content Delivery API would be a nice enhancement request. :-) Commented Jan 4 at 15:58
  • Checking around I know at least customer that uses a Deployer Extension to manipulate the location of binaries published with template-less publishing. So it's possible but with Content Delivery logic rather than Content Manager. Commented Jan 16 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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