| Mike Parris 2007-04-25, 7:17 am |
| How do I create a navigation control in MOSS2007 that shows pages as well as
sites?
I have tried a PortalSiteMapDataSource bound to an aspmenu, but it only
shows sites, no pages. Here's my code -
< PublishingNavigation:PortalSiteMapDataSo
urce ID="GlobalNavDataSource1"
Runat="server" SiteMapProvider="CombinedNavSiteMapProvider"
ShowStartingNode="false" StartFromCurrentNode="true"
StartingNodeOffset="0" TrimNonCurrentTypes="Heading"
TreatStartingNodeAsCurrent="true" />
<SharePoint:AspMenu ID="GlobalNav1" Runat="server"
DataSourceID="GlobalNavDataSource1" Orientation="Vertical"
StaticDisplayLevels="4" MaximumDynamicDisplayLevels="0"
Font-Size="Smaller" Font-Names="Arial">
</SharePoint:AspMenu>
I have also tried, and this is the way I really want to go, building a user
control based on the PortalSiteMapProvider.
I have set the provider to include pages using -
_provider.IncludePages = PortalSiteMapProvider.IncludeOption.Always;
I am getting the child nodes using -
SiteMapNodeCollection nodes =
_provider.GetChildNodes(startingNode,
Microsoft.SharePoint.Publishing.NodeTypes.All,
Microsoft.SharePoint.Publishing.NodeTypes.All);
However, the nodes collection only contains site objects, no pages.
Are there any properties that I need to set to get page information?
|