Blog

Top Navigation Buttons (New York)

Add buttons in the ServiceNow top navigator bar to link to other sites.

In this example, it links to the Service Portal, but you could adjust the code to link to other sites

Service Portal Icon in Top Right Corner

Code

UI Script
API Name: sne_sp_link
Application: Global
UI Type: Desktop
Global: true
Description: Add a button to the ServiceNow top navigation to link to the Service Portal www.servicenowelite.com
Script:

function sne_sp_link () {
	if (typeof jQuery === 'function' && typeof top.$j === 'function') {
		jQuery(document).ready(function () {
			var top = window.top;
			if (typeof top.sne_sp_link != 'undefined') {
				return;
			}
			top.sne_sp_link = true;
			var title = "Service Portal";
			var widgetHtml;
			widgetHtml = '<div class="navpage-header-content">' +
				'<button data-placement="auto" class="btn btn-icon icon-global"' +
				' title="' + title + '" data-original-title="Service Portal" onclick="window.open(\'/sp\', \'_blank\');">' +
				'<span class="sr-only">Service Portal</span>' +
				'</button></div>';
			top.$j('#sysparm_search').parents('div.navpage-header-content').first().after(widgetHtml);
		});
	}
}
sne_sp_link();

ads.txt