Table of Content Web Part: Slightly different in SharePoint 2013 / Online

The Table of Contents web part has been part of SharePoint’s make-up for a while now. It is useful function that is normally used to display a sitemap or to provide navigation for a sub site.

The Table of Contents Web Part has three main sections in the configuration pane:

  1. Content: This is where you configure what part of site hierarchy the Web Part displays. Enter the path to the page where you want to Table of Contents to begin in the Start From field. You can choose how many levels to display in the Table of Contents by using the Levels to Show drop-down list
  2. Presentation: This section controls how the items display. You can choose to display everything in a single column or multiple columns and select how the header is styled by selecting an option from the Header Style drop-down list
  3. Organization: Decide how you want the items sorted by selecting either the Sort Contents as They Are Sorted in Navigation or the Sort Contents Using the Following Settings radio button. If you choose the latter option, select applicable options from the Sort Sites By, Sort Pages By, and Sort Direction drop-down lists

For the most part, this functionality has remained exactly the same throughout the versions. However looking at the configuration options in SharePoint 2013 reveals one slight omission: the Display Columns setting.

This setting allowed you to specify the number of columns that the content was displayed in. However, in SharePoint 2013 / SharePoint online, the default column number is one. What this can potentially result in is a web part that displays its content in a very elongated, vertical manner.

To get around this, you can use the linked PowerShell Script to set the display column count. Please note that 7 is the maximum column count that you can use.

The variables that you will need to amend are: –

  • $web: Set this to the site level with the Table of Contents Web Part
  • $pages: Set the page name here that has the Table of Contents Web Part

Please note that the page itself must be checked in and published.

The script can be downloaded from the TechNet Gallery here.

The CodePlex Corner: JavaScript Editor for SharePoint (JEFS)

The link to the project is http://jefs.codeplex.com/

This edition of the CodePlex Corner looks at a project called JavaScript Editor for SharePoint or JEFS for short. It has been coded and released by Tomek Stojecki and is available for SharePoint 2010 (all editions) as a sandboxed solution. The project provides some nifty features for WFE development, and anyone who’s ever been tasked with JQuery or CSS changes to their SharePoint installation will appreciate the utility that JEFS provides. It effectively does away with the necessity of having to use Content Editor Web Parts to hide and tweak code.

It’s fair to state that a large number of CodePlex projects are poorly documented, but JEFS is a project that bucks this trend. Tomek has provided a well written introduction, which explains both the components and the history of the project. He also provides an installation guide and a PowerShell script for easily installing it. This script will detect previous installs of the project and will ask if you want to back-up any content created in it prior to being upgraded.

Because JEFS has been packaged as a sandboxed solution there are several things to keep in mind. For those that aren’t aware, a sandboxed solution is one that doesn’t have full access to all of the server or system resources. Nor can they access content outside of the Site Collection that they are deployed to. The plus point of this restriction is that the solution doesn’t need to be installed by a systems administrator. As such, a clear benefit here is that the IT department need not be involved – JEFS can be installed by the site collection administrator instead. It should also be noted that as a sandboxed solution, JEFS usage is governed by the resource throttle limits set by your SharePoint administrators. This resource throttle is a configurable maximum of daily resource points for site collections, which if breached, terminates all sandboxed solutions for running for the remainder of the day.

So, with all that being said the next logical question is; what does it let you do? Put simply JEFS is an in-browser editor that does away with the need to bundle code in CEWPs. It provides one single resource for managing all of your JavaScript, CSS and library references. This screenshot shows code positioned within two panels of JEFS. The drop down menu highlights the JavaScript libraries that are available for referencing in any solutions.

Separating out this code into clearly visible panels is a world away from embedding it within an HTML view or adding JQuery (and other library references) directly into .aspx pages via Designer. It additionally removes the frustration of seeing SharePoint mangling any structural formatting of code that it placed in a CEWP. Lastly, depending upon where JEFS is invoked from, you also have the ability to select which web part zone your changes are applied to. Add into the mixture syntax specific highlighting for each distinct panel and language, and JEFS becomes both a powerful and time saving tool.

As mentioned earlier, some JavaScript libraries are available for inclusion in your code. Tomek has packaged the following libraries with the product as well as including an editing panel in which they can be referenced: –

  1. JQuery
  2. JQuery UI
  3. SPServices
  4. Ext JS
  5. Knockout

Another part of the power that JEFS adds is where it interfaces within SharePoint. The screenshot below shows the JEFS entry point on a web part page but it is also accessible from: –

  1. List view and form pages
  2. Document library view and form pages
  3. Wiki pages

As a sandboxed solution, JEFS also has the capability to run within both SharePoint 2013 and Office 365. When looking at the functionality and set of features included with these platforms, one in particular stands out: the NAPA editor for Office 365. This is also an in-browser editor, but one that is provided specifically for application building in a cloud environment. As such, a quick feature comparison between the two presented side by side may be useful. Please note that is not offered as a fully exhaustive list.

NAPA Functionality for Office 365

JEFS Functionality for SharePoint 2010

  • No desktop installation needed – launches within the browser
  • Allows you to connect to Visual Studio
  • Allows editing of CSS, JavaScript and HTML
  • Syntax highlighting and IntelliSense
  • Ability to package and publish apps via the Office Store or internal app catalogues
  • Similarity to IDE environment and ability to edit .aspx pages
  • JavaScript, HTML and CSS editors with syntax highlighting
  • Ability to easily reference external JavaScript libraries such as jQuery
  • Sandboxed solution for localised activation
  • Split screen with resizable panels
  • Ability to add the content editor web part to the web part page and link it to the HTML content of JEFS
  • Launched from Ribbon, can be added to other navigation components within SharePoint

 

As with any choice of tool, understanding your needs will have a deciding influence on which tool to pick. JEFS lends itself well to rapid code deployments for WFE development. It is a further timesaver in that things like HTML source views and SharePoint Designer changes can be consigned mostly to the past. NAPA as a utility that has been built specifically for Office 365 has different tools aimed application development for the cloud edition of SharePoint. Both of them are developer tools, but with different scenarios in which they can most effectively be utilised.

As JEFS is a browser-based editor, being aware of browser support for SharePoint 2010 is advantageous. The tool, as with SharePoint itself, was designed with specific browser support in mind. Microsoft has published a TechNet article that discusses browser support and compatibility. This article can be read on this URL

HTML document Standards mode within IE comes into play when using JEFS. As IE allows you to specify both the browser standard and the document mode standard used for page rendering, selecting the correct ones for your development work is important. For example, developing a page in IE9 uses a Document Mode (IE7 standards) that can render things very differently than later standards. Ensuring that any JEFS output is tested sufficiently against both the IE compatibility and document modes can save further problems in the future.

Link to SharePointReviews.com product review

The product entry for JEFS on SharePointReviews.com has been posted under Development & Deployment à Development Tools. The link is http://www.sharepointreviews.com/sharepoint-development/1284-Javascript-Editor-for-SharePoint

“End User – Developer” scale

Trying to determine the best audience for JEFS is somewhat difficult. This is a tool that has two potential audiences: –

  1. SharePoint Developers
  2. IT Professionals that are tasked with making changes

Despite the second group standing to benefit from JEFS, the tool is clearly more suited to those that are comfortable with the various languages that are involved with WFE customisation. For that purpose JEFS scales more towards the developer rather than power users or administrators.

Potential pitfalls / problems

As with any new solution that you want to introduce to a SharePoint deployment, testing and configuration are important parts of good IT governance. The only issues that you may experience with JEFS are: –

  1. Broken rendering when used on sub-sites: – If an older version of JEFS has been installed than an error may be experienced which involves a broken web service call that tries to call web part zones. This was fixed in the January 9th release of JEFS (beta 2.03)
  2. Debug set to the correct standard: Be wary of the standards used. Mostly applicable to Internet Explorer, the document mode can have some differing results on your rendered results

Tutorials

Two companion tutorials have been written to accompany this article to highlight how JEFS can be used. These are: –

  1. Building a small application in JEFS using the Rotten Tomatoes API (pending)
  2. Editing a SharePoint form in JEFS using JQuery and SPServices (pending)

Conclude and add any relevant links

In closing, JEFS is one of the SharePoint-related hidden marvels of CodePlex. It is a tool that can potentially make life easier for both developers and IT professionals alike. When taking into account the different areas of SharePoint that JEFS can be invoked from, it feels like a natural extension to the SharePoint platform. The tutorials above are designed to give you a flavour of how you can use JEFS, but it is capable of much more.

A lot of credit needs to be given to Tomek for both coding up and releasing JEFS and for his contributions to this column.

The resources below were referenced for this article: –

  1. JEFS on CodePlex
  2. Introducing NAPA
  3. Tomek’s Twitter Feed
  4. Resource Limits on Sandboxed Solutions

Introducing the CodePlex Corner for SharePoint

Introduction

Welcome to the first of what I hope will part of a regular series of articles under the (not very creative) moniker of “The CodePlex Corner.” I´ve had the idea of a frequent column focuses on the community Open Source SharePoint options for a while. Originally I posted this article on NothingButSharePoint.com in July 2012 but for a few reasons I never got around to developing the series any further. Since the original article was written and published, a new version of SharePoint has been released; new MVPS have been nominated and of course, new CodePlex projects have been started and launched.

Having recently checked the project count at CodePlex for anything related to our favourite Microsoft Platform, the number of projects across all iterations of SharePoint is pretty impressive. There are a few ways to set the search filters but having settled on just searching for “SharePoint” and selecting stable projects only, a search turned up 2272 items. Many of which I suspect aren´t very well known to the SharePoint Community.

    

What is CodePlex / Brief history of Open Source Software

To properly understand the aims of communities like CodePlex, a brief detour down history lane is somewhat necessary. Most technology orientated readers coming to NBSP.com will have heard the phrase “Open-Source” before and will very possibly have a few examples at hand from their own experiences. But having exposure to a term or a phrase doesn´t necessarily confer understanding of it. Let´s have a look shall we?

On a basic level, the notion of Open-Source can be perceived as a philosophy that encourages the no-cost redistribution and free access to a product´s design and implementation details. Whilst for people such as you and I, this translates to software source code, it has translated into a few other industries, such as OpenCola (Open Source Cola) and Brewtopia (Open Source Beer).

Specifically for software, this will pertain to having access to the source code under specific licenses (the most famous of which is the GNU General Public License (GPL)) under which further development and distribution are permitted, so long as any future advancement are made available under the same license. Another common feature of Open-Source software is that it is frequently developed in public, collaborative environments such as sourceforge.net.

As you can probably imagine, the public and free nature of Open-Source software goes against the proprietary licensing model that firms such as Microsoft are built on. Whether you see Open-Source software as a methodology, a design philosophy or cost-saving measure, it is a movement that cannot easily be ignored. Historically some quarters have championed Open Source software as a successful alternative business model to proprietary licensing (Red-hat anyone…?) they´re not as mutually exclusive now as they may have been a few years ago.

It´s on this basis that CodePlex has been born, it´s a Microsoft Project site for Open Source projects, many of which can complement and extend licensed Microsoft Products. It´s important to note though, that even though some Microsoft employees and MVP/MCC level members of the community contribute to CodePlex projects, Microsoft don´t support them in any way.

Structure of the Articles

So, with all that being said, what do I hope to achieve? I´d like to offer to the community with each article an exploration of a specific CodePlex project. Whilst some of the more famous and well published CodePlex hosted projects are well documented and explained, there are many that aren´t. As such, this can lead to confusion as to whether a project is useful, whether they may be allowed to use it or not and so on. Additionally, it can also be difficult to ascertain where on the “End User – Administrator – Developer” scale that a project can sit.

Furthermore, in the time I spend in the Technet forums, it’s very common to see CodePlex projects offered as potential solutions to whatever issue a poster may face. More often than not, many of these solutions aren’t explained, nor are they linked to useful documentation or blog posts. The point of these series of articles isn’t to create literature for other people’s work but to help fill an educational gap

After a quick discussion with Marc Anderson (SharePoint MVP responsible for SPServices) last year ago, I´ve settled on the following format for exploring any CodePlex project.

  1. Introduction to the project
  2. Link to SharePointReviews.com product review (If it has one)
  3. Show where the project sits on the “End User – Developer” scale
  4. Discuss potential pitfalls / problems plus example scenarios in which a project can be used
  5. Conclude and add any relevant links

Categorisation of the articles

In looking to maintain a form of synergy with SharePoint Reviews, I’ll be categorising the solutions discussed in each article into the same categories. These are

  1. Content Management
  2. Administration
  3. Deployment
  4. Business Productivity
  5. Business Solutions
  6. Look & Feel
  7. Social & Mobile
  8. Search & Findability

Conclusion / Comments

In looking to close out, I´d like to open the floor to comments, suggestions and criticisms. I´ve got “play order” of projects that I´d like to get started with but if anyone within the wider community has something in particular they´d like to see, please let me know. If you´ve got a project yourself I can look at, or if you´ve a need for something that might be in CodePlex but haven´t found yet, I’d also like to hear from you.