How to make a widget title clickable

A cool feature that's possible through the developer framework is to make the title in a widget to be clickable, such that a user can click on it and navigate to another page within the intranet.

This is something that's fairly easy to do using the developer framework and some custom MasterPage Javascript as shown below.

$(document).ready(function() {
  $("li[data-widgetinstanceid='3305']").on('click','.widgetTitle', function(){
    window.location.href='/Interact/Pages/Content/Document.aspx?id=1118';
  });
});

In this example, when the user clicks on the title of the widget, the browser navigates to a particular page within the intranet. This will work for the specific widget which has an instance id of 3305, but won't do anything to the other widgets on the page.

The id of the widget can be discovered by inspecting the element on the page and looking at the widgetinstanceid data attribute on the li element.