Dashboard > Castle Contrib > ... > Castle.MonoRail.ViewComponents > Breadcrumb Component
Log In   View a printable version of the current page.
Breadcrumb Component
Added by James Curran, last edited by James Curran on Jul 24, 2009  (view change)
Labels: 
(None)


BreadcrumbViewComponent Class

ViewComponent to display a set of text hyperlinks that enable users to more easily navigate a Web site, while taking a minimal amount of page space. public class BreadcrumbViewComponent

Remarks

ViewComponent modeled after the standard ASP.NET SiteMapPath WebControl. In fact, much of the documentation below has been adapted from the MSDN entry on SiteMapPath

The BreadcrumbViewComponent is a site navigation control that reflects data provided by the SiteMap object. It provides a space-saving way to easily navigate a site and serves as a point of reference for where the currently displayed page is within a site. This type of control is commonly called a breadcrumb, or eyebrow, because it displays a hierarchical path of hyperlinked page names that provides an escape up the hierarchy of pages from the current location.

The SiteMapPath control works directly with your Web site's site map data. If you use it on a page that is not represented in your site map, it will not be displayed (it will generate an empty "<div></div>", however)

BreadcrumbViewComponent is a line component with 11 optional parameters.

Section Description
SiteMapFile The site map file String, Optional, defaults to "~/web.sitemap"
Provider A SiteMapProvider that is associated with the ViewComponent. You will generally not need to set this. It is normally set by setting the SiteMapProvider property; or, if that's not set, to the default specified in the web.config; or, to the file specified by the SiteMapFile property; or, to the web.sitemap file.
SiteMapProvider The name of the SiteMapProvider used to render the site navigation control.
cssClassNode The name of the CSS class to be used for the titles & links for nodes, besides the root & current. string, defaults to "breadcrumbNode"
cssClassCurrent The name of the CSS class to be used for the titles & links for the current node. String, defaults to the value of cssClassNode.
cssClassRoot The name of the CSS class to be used for the titles & links for the root node. string, defaults to the value of cssClassNode.
cssClassSeparator The name of the CSS class to be used for the separator between nodes string, defaults to the value of cssClassNode.
PathSeparator Text be used for the separator between nodes. MUST be Html Encoded string, defaults to " &gt; " (" > ")
RenderCurrentNodeAsLink Indicates whether the site navigation node that represents the currently displayed page is rendered as a hyperlink. (Boolean, default to false)
ShowToolTips Gets or sets a value indicating whether an additional hyperlink attribute for navigation nodes is written. Depending on client support, when a mouse hovers over a node that has the additional attribute set, a ToolTip is displayed. (Boolean, default to true)
ShowRoot Indicates whether the top-most site navigation node is displayed. (Boolean, default to true)

TODO: Future development will include implementing the PathDirection property as it is in SiteMapPath, and adding section support for templates for #Node, #CurrentNode, #RootNode, and #PathSeparator

Site running on a free Atlassian Confluence Community License granted to Castle Project. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators