The PortalSiteMapDataSource is a data source specific to Office SharePoint Server 2007 that retrieves data from the PortalSiteMapProvider object and exposes data according to the ASP.NET 2.0 hierarchical data source interface. The PortalSiteMapDataSource object specifies the name of the PortalSiteMapProvider object it uses to retrieve data through the ASP.NET 2.0 SiteMapProvider property.
When the master page markup includes the DataSourceID=”GlobalNavDataSource” attribute, the application returns a PortalSiteMapDataSource object.

<PublishingNavigation:PortalSiteMapDataSource ID=”GlobalNavDataSource” Runat=”server” SiteMapProvider=”CombinedNavSiteMapProvider” ShowStartingNode=”false” StartFromCurrentNode=”true” StartingNodeOffset=”0″ TrimNonCurrentTypes=”Heading” TreatStartingNodeAsCurrent=”true”/>

The properties are,

  1. ShowStartingNode – Affects whether the starting node is returned by the data source.When this property is set to true, the data source returns the starting node. The menu receives the starting node, which can be the root node, and items below the starting node.When this property is set to false, the data source does not return the starting node. The menu receives only the items below the starting node.
  2. StartFromCurrentNode – Affects where the data source starts. That is, this property sets which section of the overall site hierarchy the data source control returns to the menu.When this property is set to true, Office SharePoint Server 2007 instructs the PortalSiteMapDataSource object to apply its rules for determining where it should be starting.
  3. StartingNodeOffset – Gets or sets a positive or negative integer offset from the starting node that determines the top-level site hierarchy that is exposed by the DataSourceControl object.The default is 0, which indicates that the top-level site hierarchy exposed by the SiteMapDataSource object is the same as the starting node.The effect of this property is variable, undefined, and depends on site hierarchy details that are out of scope for this topic.
  4. TrimNonCurrentTypes – Allows context-based and type-based node trimming.
    In this example, TrimNonCurrentTypes=”Heading”, which instructs the data source to remove any nodes of type Heading that are not directly below the current node.
    You can specify multiple values for this property in a comma-delimited list. Available values are defined in the
    NodeTypes enumeration.
  5. TrimNonAncestorTypes – Trims any specified types that are not directly below the current site or one of its ancestors.
  6. TrimNonAncestorDescendantTypes – Trims any nodes of specified types that are not below the current site or one of its ancestor or descendant sites.
  7. TreatStartingNodeAsCurrent – Affects which node is treated as the current node for trimming purposes. By default, current node refers to the node representing the item that is currently being visited.When TreatStartingNodeAsCurrent is set to true, the starting node of the data source is treated as the context or trimming node.



3 thoughts on “PortalSiteMapDataSource

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s