TaxonomyWebTaggingControl represents a generic Web control for picking managed metadata terms.
During initialization two properties are mandatory to bind this control with Managed Metadata Service (MMS):
Below is presented example how to initialize it
Let us consider the case when not all terms for the term set should be shown but a subset only. Assume we have the following structure for the countries:
and our goal to display countries in TaxonomyWebTaggingControl only for selected continent as shown below
This could be achieved by setting AnchorId property for TaxonomyWebTaggingControl control that allows to specify ID of parent Term for any valid value in control.
Country picker allows to select continent/country from Countries term set.
Depending on the selected continent only countries specific for continent are shown in TaxonomyWebTaggingControl control
The code below contains Country Picker implementation:
SharePoint 2013 introduces functionality to integrate location information and maps in SharePoint lists and location-based web and mobile apps for SharePoint with the following capabilities:
- new field type named Geolocation that enables you to annotate SharePoint lists with location information. The built-in Geolocation field can render only with Bing Maps. However, you can create a custom field by using the Geolocation field as a parent field type, for example see my blog post about using Google Maps as map service.
- Map View that displays a map (with data obtained from the Bing Maps service), using longitude and latitude entries from the Geolocation field type
Client-side rendering for Map List View in SharePoint 2013
Map List View in SharePoint 2010
But what about SharePoint 2010? Let’s discuss one approach related with customizing List View for XSLTListViewWebPart (XLV) . So, in proposed solution geographical locations are stored in Custom List and custom View is used to render data on Map using Google Maps service For example, list items
will be represented in Map View as shown below
Implementation of Map List View in SharePoint 2010
As was noted earlier for storing geographical location on a map and visualizing it in Map View we will define Custom List named GeoMap List.
GeoMap Content Type
For storing geographical locations we define the following Content Type
GeoMap List is based on Generic List with GeoMap Content Type and with custom View
XSLT stylesheet for Map List View
GeoMap rendering control
- How to: Customize the Rendering of a Field on a List View in SharePoint 2010 on MSDN
- How to: Customize a list view in apps for SharePoint using client-side rendering on MSDN
The creation of non standard presentations for Lists/Libraries is a fairly common scenario and using the XSLT List View Web Part (XLV) possibilities that can be achieved pretty easily.
Let’s take a look how to render list of question and answers using Accordion Menu in SharePoint. Actually the idea for this post appeared after posting of corresponding question on StackOverflow.
So, let’s discuss how it could be accomplished using XLV. For Accordion we will utilize jQuery UI library.
FAQ Custom List
First of all, let us define where the questions and answers (FAQ) we’ll be stored. For this we will use Custom List with Content Type.
After creating Custom List we add new View for displaying Accordion for FAQ items
XSLT style sheet for rendering Accordion View
XSLT style sheet for FAQ List is intended for the following purposes:
- loading jQuery Core and UI Libraries
- rendering list items using layout as specified for Accordion menu
- initializing and rendering Accordion for List items
Using jQuery UI Accordion
FAQ List Accordion View rendered in XLV is shown below on picture
Previous two posts were devoted to discussion of how to integrate video from YouTube and another Video Providers into SharePoint. In the first post we have discussed how to store embedded video properties and render YouTube player using Computed Field. In the second one we have discussed how to store embed code itself as it was generated by Provider.
This time we will discuss at how you can aggregate video from RSS/Atom Feeds and provide some information about using API for retrieving video content from Video Providers.
Aggregating from Video Providers RSS/Atom Feeds using YouTube
When you retrieve a video feed or list of search results, YouTube returns an Atom feed. Below is presented description of how to display videos from YouTube Feed, in our case we will display results from YouTube channel only.
For retrieving video content and displaying results YouTube Viewer web part will be used here. In fact, it is just RSSAggregator web part, but with custom XSLT style sheet for processing YouTube feed, for details see implementation section.
So, let’s see how to add video from YouTube feed on page:
- Add YouTube Viewer web part which located under category Media Extensions on page
- Specify FeedUrl for YouTube channel, for example to display video feed from Critical Path Training specify value as shown on picture
- Result page with YouTube web part configured is shown below
Utilizing Video Providers API
The table below represents summary information about API for commonly used Video Providers listed in oEmbed.
Table 1. API support for Video Providers.
And for displaying it we need some logic to be implemented, for example by creating custom web part. Implementation details for this functionality are omitted here.
For aggregating and rendering YouTube Feeds RSSAggregator web part is used as was noted earlier with custom XSLT style sheet for processing YouTube Video Feeds.
To render YouTube feeds we provide custom XSLT style sheet by specifying XslLink property
and the following XSLT style sheet
In previous post we have discussed approach on how to embed video into SharePoint from YouTube. Custom List Video Links were used for storing embedded video properties and Computed Field for rendering Video player.
This time we will extend our solution with the following capabilities:
- Support for different video providers listed in oEmbed
- Preview view for displaying video arranged in list
- Alternative mode for posting the embed code for video into SharePoint
Support for different video providers
In addition to embed code using iframe, another options also available now. Some providers listed in oEmbed specification use object element for embedding code.
Table 1. Support for Video Providers listed in oEmbed specification
Alternative mode for posting embedded code
Additionally to existing mode for embedding video code, the approach described below allows to paste the embed code as it was generated by Provider. Let’s take a look at the common usage scenario:
- Generate and copy the embed code on the Provider website
- Select Embed Code from New Item for Video Links List
- In New Form for Video Links List paste the embed code and fill in comments if needed as shown below
For displaying video player the same (see previous post for details) Computed Field EmbeddedVideoOnForm field is used
Preview view for displaying video
In addition to default view (video player items with details), Preview view is intended to display items arranged by columns as shown below
To paste the embed code we define Embed Code Content Type
where field EmbedCode for storing the embed code is used
As was noted earlier, for displaying video player the same (see previous post for details) Computed Field EmbeddedVideoOnForm field is used, below is presented complete XSLT style sheet for rendering of a field on a List View
The solution described here allows to embed video hosted on YouTube into SharePoint. The same approach may be applied for embedding video from another video hosting sites, for example from Vimeo.
The main idea here to store embedded video properties and not the embedded code itself.
For storing embedded video properties we will use Custom List, see implementation section for description. Page for Video Links list (default view with embedded player) is shown below
In order to embed a video into SharePoint:
- On YouTube site click the Share button located under the video.
- Click the Embed button.
- Copy at least src attribute value provided in the expanded box (see table 1 for supported attributes).
- Create new Video Link item and paste attribute values for embedded code into Video Links item. Save it.
Table 1. Mapping between embedded code iframe attributes and Video Link item
||Video Links field name
Video Links implementation
As was mentioned earlier only properties for embedded video code are stored and not the embedded code itself. For storing embedded video code properties is used Custom List that extends OOB Links List (TemplateType = 103)
For embedded video properties we create Video Link Content Type that inherits from Link CT (0x0105)
where we define the following fields
Pay attention, for rendering YouTube player Computed Field EmbeddedVideoOnForm is intended.
For rendering of a field on a List View the following XSLT style sheet is used
And finally, we create List Definition Video Links from Content Type Video Link. List schema and Template files for Video Links including whole project may be found on GitHub.
- Video Links project on GitHub
- How to embed Vimeo player see here
- How to embed YouTube player see here
- How to customize the rendering of a field in List View see here
Posted in SharePoint 2010
- Tagged Computed Field, Content Type, Custom List, Links List, List Definition, List Schema, List Template, SharePoint, SharePoint 2010, Vimeo, XSLT, YouTube
It is known that OOB Content Query Web Part (CQWP) renders results using Lists for arranging items as shown below
In ASP.NET WebForms for Web Control DataList there is a possibility to specify layout rendering mode using property RepeatLayout, what if the similar functionality would be available in CQWP?
So, our goal to extend CQWP, i.e. in addition to List Layout rendering mode, lets implement functionality for rendering Content Query Web Part results in Plain Old Table Layout.
In this approach, we would like to achieve the following options:
- Possibility to easily arrange results in columns
- Specify items direction (horizontal or vertical)
Content Query Web Part Class
Tool Part Class Implementation with the ability to specify Table Layout properties
Web Part manifest file
Pay attention that we provide custom XSLT for processing of the CQWP, for more details see How to: Customize XSL for the SharePoint Content By Query Web Part.
Main XSLT style sheet for rendering results in Table Layout
Below is shown Web Part configured to display results in 4 columns and horizontal mode layout
As described in Metadata navigation overview (SharePoint Server 2010), metadata navigation includes the following user controls:
- Navigation hierarchies Use and expand the capabilities of list views to navigate hierarchies of folders, content types, choice fields, or managed metadata term sets. This allows users to use list views to filter on a metadata hierarchy just like navigating folders
- Key Filters This control appears below the site hierarchy control and can consist of several fields such as date, choice, content type, single and multi-value fields, currency, yes / no, and user fields. Any number of key filters can be applied in combination with a selected navigation hierarchy.
Navigation hierarchies and KeyFilter user controls registration and also rendering templates for KeyFilter control are defined in MetadataNavTree.ascx and MetadataNavKeyFilters.ascx files.
Our goal here to show possible ways on how KeyFilters control could be customized from the UI perspective.
Below is represented diagram on how KeyFilters control is rendered.
Depending on field type different rendering templates for composite field are applied as shown in table below.
|Composite field rendering template name
||for range capable field such as Choice
||default rendering template for key filters composite field
But KeyFilter control has some limited functionality regarding customizing List Field Iterator and composite field templates, for example it is not possible to specify alternative templates for composite field templates.
One of the possible ways for making KeyFilters control UI customization more flexible is to extend it by allowing to specify custom templates for composite fields.
Project with custom Key Filters control implementation is located here.
Resulting page with custom KeyFilters control and custom rendering templates applied is shown below. In this example control field label and value in composite fields rendering templates are rendered in one row mode.
SharePoint 2013 Preview introduces a new field type named Geolocation that enables you to annotate SharePoint lists with location information. In columns of type Geolocation, you can enter location information as a pair of latitude and longitude coordinates in decimal degrees, or retrieve the coordinates of the user’s current location from the browser if it implements the W3C Geolocation API. For more information about the Geolocation field, see Integrating location and map functionality in SharePoint 2013.
By default location is rendered using Bing Maps but it could be customized, for example by creating custom Geolocation field that renders Nokia Maps as described here.
What about another Map providers, let’s take a look on how to implement geolocation field that renders Google Maps.
First of all we need to create custom Geolocation field, for details see How to: Create a custom Geolocation field that renders using Nokia Maps.
Here we will only implement Geolocation field template for Google Maps, all the remaining steps the same as described in How to: Create a custom Geolocation field that renders using Nokia Maps. This is client side rendering template file that JSLink method of the field class points to, for more information see How to: Customize a field type using client-side rendering
Below is presented GMapsGeolocatioFieldTemplate.js rendering template for Google Maps.
SharePoint 2013 project with implementation of custom geolocation field that renders Google Maps may be found here.
- Creating Google Maps Geolocation column
- List view with Google Maps Geolocation column
- Create or edit form with Google Maps Geolocation column
For searching locations on Edit form is used Google Geocoding API.
Sometimes in SharePoint we need to visualize hierarchical data as organizational chart. Prerequisites: not to use Flash or Silverlight technologies here.
So, in our scenario for storage of organization structure will be used SharePoint List based on Custom List , for rendering engine Google Chart Tools.
First, let’s take a look at list’s schema for storing organizational structure
||Used for parent/child relationship
||Display text for chart box
||Visual behavior for chart box
From Google Charts library we’ll use Organizational Chart package only.
1. Google Charts Tools loading and package initialization
2. Fetch data using SharePoint Web Service from list that contains organizational structure
3. Bind data source and draw chart
Result page with Org Structure rendered as Chart in List View