Thursday, January 08, 2015

Cross Site Task List Views with SharePoint 2013

We just saw how simple it is to select one or more task lists to view within a SharePoint site, but what about task lists across SharePoint sites? IntelliGantt for SharePoint makes it easy by letting you add as many cross site task lists as you like while still letting you select which ones to show and in what order. Let's take a look.

Here is where we left off in the last post. We have two task lists within the 'Demo 3' site, of which we have edited the configuration.js file so that only the 'More Tasks' task list is displayed.

We added a subsite to Demo 3 named 'Demo 3 Subsite'. Within this subsite we've added another task list app and added two tasks to it.

What we would like to do is display the 'More Tasks' from the site 'Demo 3' AND display the tasks from this subsite in a single IntelliGantt view.

No problem!

First let's go to the configuration.js file we added to the Site Assets in the Demo 3 site.

Locate the 'sites' parameter that defines an array of site information within the configuration.

We will simply add another array element to 'sites' that tells IntelliGantt to load tasks from the 'Subsite' directory. If you're familiar with JSON syntax this should be straightforward. If you're not, well, it's javascript and there's lots of help available for manipulating javascript arrays. The new element to the array we will add contains a url, another array of lists to include and a final array of lists to exclude. As described in the previous post, the lists are matched by title. For the 'url' field, you can make it relative to site the configuration.js is located in. So, to include the subsite we simply concatenate the current site location './' and the subsites location 'Subsite/' and end up with the string to use './Subsite/'. Note that IntelliGantt requires you to end urls with a '/'.

Now we refresh the page IntelliGantt for SharePoint is placed on and voila, we see the subsite tasks included in the view.

What about sites that are not subsites? Can IntelliGantt include tasks from a site from a different path?


Here we have a site called 'Demo 2' which is located under the SharePoint root-- no awareness of 'Demo 3' at all.

We can tell IntelliGantt to include tasks from 'Demo 2' by going back to the configuration.js file and adding another entry to the 'sites'. The difference this time is the url parameter will be an absolute path instead of a relative path. Basically this means the url field starts with a slash and has the full path location of the site you wish to include.

We refresh the IntelliGantt for SharePoint instance back in our 'Demo 3' site and now we see three task lists. First, the 'More Tasks' task list we selected from the current site. Second, the 'Tasks' list from the subsite. And, third, the task list from the 'Demo 2' site we identified with an absolute url.

Just as there is no limit to the number of tasks you can view, there is no limit to the number of task lists you can pull in from any site within a SharePoint site collection. Also, dates and numeric data are rolled up into their 'virtual' summary tasks so its a nifty way to quickly add values across sites as well.

1 comment:

Smith said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Online Training from India . or learn thru JavaScript Online Training from India. Nowadays JavaScript has tons of job opportunities on various vertical industry. ES6 Online Training