Orchardcms Orchard CMS菜单项上的图像

Orchardcms Orchard CMS菜单项上的图像,orchardcms,Orchardcms,如何在orchard中为我的导航项目添加图像?在我的orchard应用程序中,我添加了6个导航项。如何将图像添加到所有项目?不久前有一个类似的问题: 例如,您可以为MenuItemLink编写一个备选方案,并在其中添加图像 从另一个答案来看: MenuItemLink.cshtml <a href="@Model.Href" class="my-super-cool-custom-link"> <img src="wherever/img.jpg" />@Mod

如何在orchard中为我的导航项目添加图像?在我的orchard应用程序中,我添加了6个导航项。如何将图像添加到所有项目?

不久前有一个类似的问题:

例如,您可以为MenuItemLink编写一个备选方案,并在其中添加图像

从另一个答案来看:

MenuItemLink.cshtml

<a href="@Model.Href" class="my-super-cool-custom-link">
    <img src="wherever/img.jpg" />@Model.Text
</a>

不久前有一个类似的问题:

例如,您可以为MenuItemLink编写一个备选方案,并在其中添加图像

从另一个答案来看:

MenuItemLink.cshtml

<a href="@Model.Href" class="my-super-cool-custom-link">
    <img src="wherever/img.jpg" />@Model.Text
</a>

作为@Xceno回答的后续内容,这是我在需要此功能时所做的:

  • 在内容定义的菜单栏中添加一个名为“图标”的文本字段

  • 使用以下内容覆盖“MenuItemLink.cshtml”(我使用字体awesome表示图标,更改“fa”表示您使用的任何内容):


  • @{
    var icon=Model.Content.ContentItem.MenuPart.icon.Value;
    }
    
    作为@Xceno回答的后续内容,这是我在需要此功能时所做的:

  • 在内容定义的菜单栏中添加一个名为“图标”的文本字段

  • 使用以下内容覆盖“MenuItemLink.cshtml”(我使用字体awesome表示图标,更改“fa”表示您使用的任何内容):


  • @{
    var icon=Model.Content.ContentItem.MenuPart.icon.Value;
    }
    
    为什么-1回答这个问题?我能知道吗?为什么要回答这个问题?我能知道吗?