-
Notifications
You must be signed in to change notification settings - Fork 218
Creating a first sitemap
Shad Storhaug edited this page Feb 9, 2014
·
1 revision
The following is a simple sitemap XML file that can be used with the MvcSiteMapProvider:
<?xml version="1.0" encoding="utf-8" ?>
<mvcSiteMap xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-3.0" enableLocalization="true">
<mvcSiteMapNode title="Home" controller="Home" action="Index" changeFrequency="Always" updatePriority="Normal">
<mvcSiteMapNode title="Browse Store" controller="Store" action="Index" />
<mvcSiteMapNode title="Checkout" controller="Checkout" />
</mvcSiteMapNode>
</mvcSiteMap>
The following attributes can be given on an XML node element:
Attribute | Required? | Default | Description |
---|---|---|---|
title | Yes | (empty) | The title of the node. |
description | No | (empty) | Description of the node. |
area | No | (empty) | The MVC area for the sitemap node. If not specified, it will be inherited from a node higher in the hierarchy. |
controller | Yes | (empty) | The MVC controller for the sitemap node. If not specified, it will be inherited from a node higher in the hierarchy. |
action | Yes | (empty) | The MVC action method for the sitemap node. If not specified, it will be inherited from a node higher in the hierarchy. |
key | No | (autogenerated) | The unique identifier for the node. |
url | No | (autogenerated based on routes) | The URL represented by the node. |
roles | No | (empty) | Comma-separated list of roles allowed to access the node and its child nodes. |
httpMethod | No | * | The HTTP method that will be used to check node accessibility. This value is used to select correct controller action if a controller has multiple action accepting different HTTP verbs. Set to * to use HTTP method of current request. |
resourceKey | No | (empty) | Optional resource key. |
clickable | No | True | Is the node clickable or just a grouping node? |
targetFrame | No | (empty) | Optional target frame for the node link. |
imageUrl | No | (empty) | Optional image to be shown by supported HtmlHelpers. |
lastModifiedDate | No | (empty) | Last modified date for the node. |
changeFrequency | No | Undefined | Change frequency for the node. |
updatePriority | No | Undefined | Update priority for the node. |
dynamicNodeProvider | No | (empty) | A class name implementing MvcSiteMapProvider.Extensibility.IDynamicNodeProvider and providing dynamic nodes for the site map. |
urlResolver | No | Sitemap provider's ISiteMapNodeUrlResolver instance | Class that will be used to generate URLs for sitemap nodes. |
visibilityProvider | No | Sitemap provider's ISiteMapNodeVisibilityProvider instance | Class that will be used to determine visibility for a sitemap node. |
preservedRouteParameters | No | (empty) | Optional preserved route parameter names (= values that will be used from the current request route). |
inheritedRouteParameters | No | (empty) | Optional. Route values that should be inherited from the parent sitemap node. This is not a replacement for the SiteMapPreserveRouteDataAttribute. |
Want to contribute? See our Contributing to MvcSiteMapProvider guide.
- Registering the provider
- Creating a first sitemap
- Defining sitemap nodes in code
- Dynamic sitemaps
- HtmlHelper functions
- Action Filter Attributes
- Exporting the sitemap for search engine indexing
- Advanced node visibility
- Extension points
Other places around the web have some documentation that is helpful for getting started and finding answers that are not found here.
- MvcSiteMapProvider 4.0 - A Test Drive
- MvcSiteMapProvider 4.0 - SEO Features Tutorial
- How to Make MvcSiteMapProvider Remember a User’s Position
- MvcSiteMapProvider 4.0 - Cache Configuration
- MvcSiteMapProvider 4.0 - Extending the Cache
- MvcSiteMapProvider 4.0 - Unit Testing with the SiteMaps Static Methods
- Debugging an MvcSiteMapProvider Configuration
- Converting from C# to Vb MvcSiteMapProvider
- ASP.NET MVC Menu using Site Map Provider & Bootstrap 3 Navbar
- ASP.NET MVC SiteMapPath using Site Map Provider & Bootstrap Breadcrumbs
- NightOwl888's MvcSiteMapProvider Demos - Filter for "MvcSiteMapProvider" to see the most relevant.
- MvcSiteMapProvider Tutorial and Examples
- MvcSiteMapProvider Tutorial 2 - Breadcrumbs
- Getting Started with MvcSiteMapProvider
- Inside the MvcSiteMapProvider - Part 1
- Inside the MvcSiteMapProvider - Part 2: Dynamic node providers
- Inside the MvcSiteMapProvider - Part 3: The ISiteMapVisibilityProvider
- Inside the MvcSiteMapProvider - Part 4: The IAclModule
- Inside the MvcSiteMapProvider - Part 5: The ISiteMapNodeUrlResolver
- Styling MvcSiteMapProvider with CSS
- Using MvcSiteMapProvider with Twitter Bootstrap
- ASP.NET MVC Menu using Site Map Provider & Bootstrap Navbar