We are running Kentico MVC 13.0.7 and are using page builder / templates / widgets to generate most of our content. The page type has a "Teaser Image" field that is a file attachment and we are attempting to use that in the template.
When we create a new page or update the image field in the pages app, it shows the image in the content tab and can link to the image directly. The link that works and generally follows the url pattern
{Admin Project Domain}/getattachment/{file guid}/{filename}.{extension}?chset={different guid}
In the site project, we are getting a strongly typed object from the page type's generated code,
PageProvider.GetPage(nodeId, "en-US", siteName).LatestVersion();
Then using the dependency injected IPageAttachmentUrlRetriever to get the "TeaserImage" url.
pageAttachmentUrlRetriever.Retrieve(pageWithTeaserImage.Fields.TeaserImage).AbsoluteUrl;
The URL we get from this call tends to follow the pattern:
{Site Project Domain}/cmsctx/pm/8b0ef3be-54bd-4a89-b60f-ac2213b839b0/culture/en-US/wg/332799f7-38b9-4814-992b-2183229d3d73/readonly/0/ea/1/h/dc08cbb2257bbb701efbbdd96b55472535771b0352fc03da19d56fa36d85f755/-/getattachment/64bf4c9d-6152-4b63-9148-212237aacce1/{fileName}.{extension}?uh=65dce9456213d29747639b306244020f2a4e69dbe559c161bc67feeb1061fc9b&administrationurl=https%3A%2F%2F{Admin Project Domain Encoded}
The only issue is that the url provided {relative or absolute} results in a 404 response from the site project.
Any suggestions on something I can check to maybe get these urls to resolve?
David
PITO WebCMS Team TAMU