Try our conversational search powered by Generative AI!
AI OnAI Off
How to reproduce
dotnet new epi-alloy-mvc
services.AddContentDeliveryApi(options =>
{
}).WithFriendlyUrl();
services.Configure<EPiServer.ContentApi.Core.Configuration.ContentApiOptions>(options =>
{
options.IncludeEmptyContentProperties = false;
options.IncludeMasterLanguage = false;
});
services.ConfigureForExternalTemplates();
services.Configure<ExternalApplicationOptions>(options => options.OptimizeForDelivery = true);
Errors
1. ForceAbsolute
option for ContentDelivery API will have no effect on the json returned from the API. Host name is always included.
2. Thumbnail images are broken in edit mode, since they are requested using the frontend host name (but with the port of the CMS host)
When decompiling the method seems it does the following
public void ConfigureForExternalTemplates()
{
ServiceLocator.Current.GetInstance<RoutingOptions>().UsePrimaryHostForOutgoingUrls = true;
RegisterFakeTemplate = true;
}
Based on that code seems to be doing what you are describing. Not sure why you would ever use primary host for images though.
If you configure the CMS to use an external frontend site (to enable on-page editing on the externa site), images will break at some places in edit mode. Thumbnail images for example.
Configuration:
Thumbnail images will get this url
https://my-frontend-host.com/EPiServer/CMS/Content/globalassets/test-assets/hero.jpg,,62/Thumbnail?epieditmode=False?1695142172388
my-fronend-host.com is the frontend site, not the CMS site.
I have tried to set the CMS-hostname to type "Edit", but that didn't help.
Is this a bug, or did I configure something wrong?