Click here to Skip to main content
16,022,362 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I cannot find a working example of using images in a sidebar.cshtml instead of the stock icons supplied with the theme bootstrap template

What I have tried:

CSHTML
<a href="#" class="menu-link">
				
								@if (menu["icon"] != null)
								{
									^__i class="@menu["icon"]"__^
								}
								@if (menu["label"] != null)
								{
									@menu["label"]
								}
				
				@menu["text"]
				@if (menuChildren.Length > 0)
				{
								class="caret">
				}
</a>


JSON
{
  "controller": "Analytics",
  "action": "Index",
  "icon": "fa fa-chart-pie",
  "text": "Triple Glazed Units"
},
{
  "controller": "Analytics",
  "action": "Index",
  "icon": "fa fa-chart-pie",
  "text": "Heritage Thin Units"
},
{
  "controller": "Analytics",
  "action": "Index",
  "icon": "fa fa-chart-pie",
  "text": "Fire Rated Units"
},
Posted
Updated 23-Jul-24 0:52am
Comments
abdalla hassan 2024 4-Aug-24 6:24am    
"controller": "Analytics",
"action": "Index",
"icon": "fa fa-chart-pie",
"text": "Triple Glazed Units"
},
{
"controller": "Analytics",
"action": "Index",
"icon": "fa fa-chart-pie",
"text": "Heritage Thin Units"
},
{
"controller": "Analytics",
"action": "Index",
"icon": "fa fa-chart-pie",
"text": "Fire Rated Units"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900