0

I created a link (.url) in a Document Library that points to a site page within another site (.aspx). If I click the link from the Document Library it redirects and opens the file fine. If I click the link from a PnP Search Results, I get SharePoint Preview page with no contents and no redirect.

The faulty URL looks pretty standard https://TENANT.sharepoint.com/sites/SITENAME/SitePages/My-Page.aspx?csf=1&web=1&e=GUIDHERE

How do I troubleshoot this?

UPDATE: This appears to be a bug in PnP and is being discussed at https://github.com/microsoft-search/pnp-modern-search/issues/1761

1 Answer 1

0

I figured it out. I created a slot named ShortcutUrl to hold the value. I then replaced this

<a href="{{slot item @root.slots.PreviewUrl}}" target="_blank" style="color:{{@root.theme.semanticColors.link}}" data-interception="off" rel="noopener noreferrer">{{slot item @root.slots.Title}}

with

{{#with (split (slot item @root.slots.ShortcutUrl) ',')}}
    <a href="{{[0]}}" target="_blank" data-interception="off" style="color:{{@root.theme.semanticColors.link}}" rel="noopener noreferrer">{{../Title}}</a>
{{/with}}

For some reason {{slot item @root.slots.Title}} did not render inside the with helper so I had to use {{../Title}}

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.