MvcSiteMapProvider icon indicating copy to clipboard operation
MvcSiteMapProvider copied to clipboard

Allow configuration of icon classes

Open jjwilliams opened this issue 10 years ago • 1 comments

With the recent boom of bootstrap, it would be nice to be able to configure icon classes for a node. I tried using imageUrl as a hack, but it gave me issues. Example css class:

fa fa-lg fa-fw fa-map-marker

Used in custom bootstrap MenuHelperModel partial:

<i class="@node.iconClass"></i>

jjwilliams avatar Feb 28 '14 05:02 jjwilliams

This behavior is already supported by using custom attributes in conjunction with custom HTML helper templates. Have a look at this answer, as well.

However, some mileage could be cut off of this process if we had a set of Bootstrap Visual Studio templates that provided some common use cases that use a common set of custom attributes. Unfortunately, the Menu and SiteMap HTML helpers are divided up into 3 pieces - I am not sure if VS supports adding more than 1 file at a time through their Add Item dialog. It is probably worth a look though. The SiteMapPath, Title, etc would be pretty straightforward, though.

If you are interested in contributing the templates and doing some research on how to add them as sets via the VS Add File dialog, I would be happy to add the templates to the NuGet package so they are installed into the right place(s) so VS will pick them up.

Reference: http://msdn.microsoft.com/en-us/library/ms247121.aspx http://msdn.microsoft.com/en-us/library/y3kkate1.aspx

NightOwl888 avatar Feb 28 '14 05:02 NightOwl888