Forum Discussion
Can we force Sharepoint doc links to open in new tab? Links are in dynamic lists generated via HCWP
We're creating a modern Sharepoint team site to store a few hundred documents. Each page covers a specific topic/theme, and our documents are tagged with the corresponding topic/theme using managed metadata. I've added a highlighted content web part to each page of the site to display filtered lists of relevant documents. So far so good.
My manager would like the links in the dynamic lists to open in a new browser tab. I can't find a way of achieving this. CoPilot said I could add a ScriptEditor web part to each page and paste a bit of code into it, then immediately contradicted itself. ChatGPT says there's no out-of-the-box solution but suggested various workarounds that either involve PowerShell or the Sharepoint Framework (SPFx). We have no in-house technical knowledge of either.
Does anybody know if there's a fairly simple non-technical way of managing how links behave? I read that it's possible in a QuickLinks web part, but I think we have to use HCWP to generate these lists.
2 Replies
- Ankit365Iron Contributor
Developing a custom SharePoint Framework (SPFx) web part can provide the desired functionality. This approach requires technical expertise and access to the SharePoint tenant's app catalog. Or else you can opt for PnP based solution
- michalkornetIron Contributor
Hi LynnProspect , you can try using the PnP web part, which offers more configurable options for presenting data and works similarly to the HCWP:
https://microsoft-search.github.io/pnp-modern-search/Do you have all the files in one Document Library? If so, you could also use the Document Library web part, assign a specific view with the desired filters, and apply view formatting to customize the layout.
https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting