Monday, July 13, 2020

SharePoint Quick Links Buttons that Go Nowhere

The Problem

When building out a test site where we might not have a lot of real content yet, we often want to create a bunch of quick links buttons so designers can get a feel for what content is going to look like. This is particularly important when you want to review a bunch of designs and test them on mobile. Typically I would create buttons that would link to my favorite external sites like Microsoft.com and Weather.com. On sites with 15 buttons that got a little boring.

What would be better?

What typically happens in HTML, an anchor tag will be created with just a # in the link which tells the browser to create the button and make it work like a button but don't actually link anywhere. If we could add that # to the link life would be great! 

So why are you telling me this?

The quick links and other button web parts have a validation in them that prevent us from just adding a #. 

The Solution

First we add the web part to the page and add a link. 
quick links web part








Then we type a # into the paste a link section. You will notice that the "Open" button never clears validation so it cannot ever be clicked.
image web part validation is still not met
















If we type in a valid URL the button validation clears. If you are following along, don't press open yet!
image the button validation is met and is clickable


















Now we just need to go back, erase our URL and replace it with the #. Our button remains clickable.
replace the url in the field with a hash



















Now we have ourselves a beautiful, clickable button to nowhere.
image of a button











In conclusion, this is one extra step to make a button that goes nowhere but when you are testing design, it is really nice when you click a button and the browser stays right where you want it.

No comments:

Post a Comment