Thursday, February 4, 2010

Show Incoming Links on a Wiki Page

I got this great script for showing incoming links on a wiki page in SharePoint from a post at http://mo.notono.us.com/. (Here is the full link to the original post http://mo.notono.us/2009/01/moss-add-incoming-links-to-wiki-page.html.)

To place it on the page, edit your wiki page and drop in a Content Editor Web Part. Then open the source editor for the web part and drop this code in. Works like a charm!

As Oskar mentions in his post, you can also add it to the master page for your wikis. There are reasons not to, of course. But it may be a great solution depending on your circumstances.

Thanks Oskar for this great tool!

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>

<script type="text/javascript">
$(function() {
//get the url for the incoming links page

u = $("a[id$=WikiIncomingLinks_LinkText]")[0].href;
//create a target container and load it with the incoming links
//filtered to show the links list only
l = $("<div id='incomingLinks' style='border-top: solid 1px silver'>").load(u + " .ms-formareaframe");
//append the new container to the wiki content
$(".ms-wikicontent").append(l);
});

</script>

2 comments:

  1. Janice, that was so helpful.

    Thank you so much, you made my day. I am becoming daily visitor of your Sharepoint blog

    ReplyDelete
  2. The link to the main site is incorrect... it's just http://mo.notono.us - no .com.

    Thanks for the link, glad the code helps!

    ReplyDelete