Oct 11 2018 06:24 AM
Dear all,
I'm trying to use the modern pages to share the news published in Old Publishing site using the Modern Repost Page solution:
Now i'm fighting with another issue related to the Picture Preview implemented into the Modern News WebPart.
This webpart is showing the last Repost Pages (created manually), but refuse to show many of the pictures associated, as you can see in the following screenshot.
I don't know why but only one picture library is supported by the preview ashx:
I checked the Details of the news to check if the picture is correctly configured into, and it works well:
When I open the Image src URL of this preview system with Internet Explorer, I received an Error 500 (Internal Server Error), with FireFox nothing is shown.
The SharePoint Root page (https://[mytenant].sharepoint.com/_layouts/15/sharepoint.aspx) is showing the image without any issue.
Is there anyone who can give my an idea to fix that ?
Fabrice Romelard
Oct 11 2018 08:17 AM
When you create a page using the UI SharePoint will pick the first (preview) image it finds and uses that as the image to display the page in the news web part. If you programmatically create pages using the PnP client-side API (so using the .Net PnP Site Core library or using PnP Powershell) then you'll have a similar behavior as the API will try to pick the first image (via entries in the imageSources JSON node), although it's not as enhanced as the native feature.
If you want to change things you could look into setting the BannerImageUrl field. We use the following construct in our API implementation:
item[ClientSidePage.BannerImageUrl] = $"{rootUri}_layouts/15/getpreview.ashx?guidSite={site guid}&guidWeb={web guid}&guidFile={image guid}";
Oct 11 2018 08:26 AM
I probably found a direction to look for this picture issue.
When I add the picture as external link, I retrieve 2 cases, success and error:
The final presentation is a mix between the 2 cases
The strange point is the access permission is ok at the end, but not into that presentation mode:
So I will try to understand what is missing into the permission set.
Fab
Oct 11 2018 08:32 AM
The issue is not into the Banner part, because the value is correctly loaded.
It's only the preview api which is refusing to show it in some mode.
I tried in another call model and it's OK:
From this URL:
To this URL:
Fab