Wednesday, March 20, 2019

Puzzlepart introduces Hook me up! – an anchor part for modern pagers

In January of 2018 I wrote a post showing how you could use the modern script editor web part to add a jump anchor to a modern page. Of course, you should shy this web part due to possible security risks (unless you really really know what you are doing).

Last night Theresa Eller was looking for a proper solution to this on twitter, so I whipped up a small web part which adds an invisible span tag to the page, which you can anchor to. If you set scrolltome as the id, you can reference it when creating a hyper link in the text web part.

image

This time around I made the code compatible with both SharePoint 2016 and 2019 as well.

Go download the sppkg file from https://github.com/Puzzlepart/spfx-solutions/tree/master/Pzl.Part.HookMeUp and install it where needed.