You are currently browsing the monthly archive for March, 2009.

Two months ago I published a simple method to display a SharePoint list in another site.

A few days ago, Nathan posted the following comment:

The one (minor) inconvenience I have found is that when you click the ID or Title field to navigate to the full record (dispform.aspx), the Close button will redirect you to the default view of the source list [...] Would it be possible to modify the script in order to append something like Source=location.href to the ID/Title hyperlink? That way, the Close button on dispform.aspx would redirect you back to the starting page.

So here we go. As Nathan points out, SharePoint offers a very convenient “Source” querystring that tells where the user should be redirected after an action is completed.

This is the modified JavaScript version:

<!-- Load and display list - iframe version -->
<!-- Questions and comments: Christophe@PathToSharePoint.com -->

<DIV id="ListPlaceholder"><IMG src="/_layouts/images/GEARS_AN.GIF"></DIV>

<!-- Paste the URL of the source list below: -->
<iframe id="SourceList" style="display:none;" src="http://domain.com/SiteCollection/SourceSite/SourceList/MyView.aspx" onload="DisplayThisList()"></iframe>

<script type="text/javascript">
function DisplayThisList()
{
var placeholder = document.getElementById("ListPlaceholder");

var displaylist = null;
var sourcelist = document.getElementById("SourceList");

try {
   if(sourcelist.contentDocument)
      // Firefox, Opera

      {displaylist = sourcelist.contentDocument.getElementById("WebPartWPQ1") ;}
   else if(sourcelist.contentWindow)
      // Internet Explorer

      {displaylist = sourcelist.contentWindow.document.getElementById("WebPartWPQ1") ;}
   else if(sourcelist.document)
      // Others?

      {displaylist = sourcelist.document.getElementById("WebPartWPQ1") ;}
}
catch(err) { alert ("Loading failed");}

displaylist.removeChild(displaylist.getElementsByTagName("table")[0]);
var allDescendants = displaylist.getElementsByTagName("*");
for (i=0;i<allDescendants.length;i++) {
allDescendants[i].removeAttribute("id");
allDescendants[i].removeAttribute("onclick");
allDescendants[i].removeAttribute("onfocus");
allDescendants[i].removeAttribute("onmouseover");
try {
if (allDescendants[i].href.indexOf("?") > 0) {allDescendants[i].href = allDescendants[i].href + "\&Source=" + location.href;}
else {allDescendants[i].href = allDescendants[i].href + "?Source=" + location.href;}
}
catch(err) {}
}
placeholder.innerHTML = displaylist.innerHTML;
}
</script>

And the modified jQuery version:

<!-- Load and display list - jQuery version -->
<!-- Questions and comments: Christophe@PathToSharePoint.com -->
<DIV id="ListPlaceholder"><IMG src="/_layouts/images/GEARS_AN.GIF"></DIV>

<script type="text/javascript">
// Paste the URL of the source list below:
var SelectedView = "http://domain.com/SiteCollection1/SourceSite/SourceList/MyView.aspx";
$("#ListPlaceholder").load(SelectedView+" #WebPartWPQ1 .ms-listviewtable",function() {
$("#ListPlaceholder *").removeAttr("id").removeAttr("onclick").removeAttr("onfocus").removeAttr("onmouseover");
$("#ListPlaceholder a").each(function() {
if ($(this).attr("href").indexOf("?") > 0) {$(this).attr("href", $(this).attr("href")+"\&Source="+location.href);}
else {$(this).attr("href", $(this).attr("href")+"?Source="+location.href);}
});
});
</script>

See the original post for more details. In particular, if you are using MOSS remember to replace WebPartWPQ1 with WebPartWPQ2 in the above scripts.

Update (March 24th): I have modified yesterday’s post to make the scripts work for document libraries as well. I have also corrected the jQuery version (thanks to Peter Allen for alerting me).

Update [6/16/2009]: I have modified the jQuery code for better performance. Thanks Danny van Loon for the advice!

Yesterday, as I was playing with the new IE 8, I discovered that I was able to access my blog from China (I mean without having to go through a proxy).

This is big, as traditionally blogging platforms like WordPress and Blogger have been blocked in China. I don’t know when the change happened.

EndUserSharePoint.com can also be accessed again.

More than a billion potential new readers…wow!

I am currently considering using SharePoint for Scrum, so I did some research on the Internet. I found several resources that use Excel, but very little on SharePoint.

If you have experimented with this, I’d be very interested in your advice… especially if you stumbled upon some road blocks!

In the past 3 months, I have been using the Technorati authority to monitor SharePoint blogs.

I started noticing a strange behavior: several sites were surprisingly stable, not seeing any change in their authority. Even more surprising, some of these sites were seldom updated, and you would have expected their authority to shrink, according to the Technorati aging policy.

After investigating this, I came to the conclusion that there was an issue with Technorati. Technorati has a process by which you can ping them to refresh a blog’s information. The downside is that apparently if blogs don’t ping Technorati then the authority doesn’t get refreshed at all.

I have of course reported the issue to Technorati.

If you are a blog owner, make sure that you ping Technorati to have your stats updated. See this page for the instructions. If you are a blog visitor and want to validate the blog’s authority, you can also use the above link.

I’d be interested in other testimonies. I have checked ~50 SharePoint blogs so far, and witnessed this issue on ~15.

Note that if you are hosted by a major platform, like WordPress.com, it will ping Technorati for you.

trend1

As a test, I have included jQuery sparklines in my February report on SharePoint blogs.

The sparklines are in the “Trend” column. They display, in bar type, the blog’s authority in the past 3 months. To build them I have combined the “HTML calculated column” with the jQuery sparklines plugin.

I have already provided a tutorial to include Google sparklines in SharePoint lists a couple months ago. The Google approach is very convenient, but its downside is that your data goes public, you send it on the Internet to get the charts in return. That’s why I am interested in this alternate option.

However, I need to do some more testing as I noticed a rendering issue. If you have more information on this plugin please let me know!

Update [03/03/09] The author of the plugin, Gareth Watts, has worked on the rendering issue I reported. It will be fixed in v 1.4.1 .

Update [04/02/09] v 1.4.1 is now available for download.

I have updated the Technorati authority in my list of SharePoint blogs. The new reference is March 1st.

Check out the February report to see which blogs have gained authority in the past month – which means that you’ll find there fresh and interesting content. If you are an end user, the blogs with an RSS icon should be the most suitable for you.

February confirms a trend: an increasing interest around end users and client side customization in the SharePoint blogosphere. The top February ”performers” are blogs dedicated to end users. And several blogs have published articles related to these topics, for example raising questions like ”Do we need SharePoint functional consultants?“, or discussing the pros and cons of client side customization (a heated debate, as you can see from the post and the comments…).

Happy reading!

Categories

I’m on Twitter!