Question

We are Using MVC Sitemap Provider in a MVC 4 application.

We have vision impaired User(s)... Is there a way to get the sitemap rendered as a static page of links, so that these users can navigate?

Is there some other better method of accessibility for these users?

Was it helpful?

Solution

Yes.

Actually, you didn't specify very well because a "static page of links" could mean many things. But you can alter the HTML that is output from the HTML helpers by changing their templates to get pretty much any result.

For example, you can change the menu HTML helper by making your own templates in the /Views/Shared/DisplayTemplates/ folder (by copying the contents of the existing ones) and then you can alter them to suit your requirements. You just need to ensure the new template is specified in the "template" argument of the HTML helper and the "child" templates are specified where the templates call the ".DisplayFor()" method.

See this answer for a sample that will get you started.

If you need to provide multiple menus (a sighted person menu and a vision impaired person menu, for example), you can also used named menus with the FilteredSiteMapNodeVisibilityProvider to get multiple menus from a single SiteMap.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top