Orchardcore: set icon for menu in module

Created on 30 Jun 2019  路  10Comments  路  Source: OrchardCMS/OrchardCore

how can i set icon in this code?

 builder.Add(T["item name"],  list => list
                   .Action("TermSection", "Admin", new { area = "Academy.OrchardCore" })
                   .LocalNav()
                    );

Most helpful comment

@aghili371

.AddClass("icon-class-fa")
.AddClass("icon-class-fa-user")

All 10 comments

You can use AddClass() for the menu item, have a look to pre-defined modules

@hishamco where i can find the list of icons?

You to remember the font-awesome classes 馃槈

i tested font-awesome classes, but it still doesn't work.
builder.Add(T["賱蹖爻鬲 孬亘鬲 賳丕賲 賲丿乇爻賴 賮賵鬲亘丕賱"], T["賱蹖爻鬲 孬亘鬲 賳丕賲 賲丿乇爻賴 賮賵鬲亘丕賱"], list => list
.Action("listRegisterInAcademy", "Admin", new { area = "Academy.OrchardCore" })
.LocalNav()
.AddClass("fa-facebook")
.Permission(Permissions.ManageAcademy)
);

No need to add the fa prefix if I'm not wrong

i have tested .AddClass("facebook") but it doesn't work

Try .AddClass("user") and let me know if it shows up

no, it doesn't work

@aghili371

.AddClass("icon-class-fa")
.AddClass("icon-class-fa-user")

@jtkech this worked!

Rather hard to find in documentation how this works or how to add your own icon set.

Was this page helpful?
0 / 5 - 0 ratings