I'm trying to replace the standard icons (like print, settings, etc.). I'm using something like this in my skin which is working fine.
<dnn:ACTIONBUTTON runat="server" ID="dnnACTIONBUTTON2" CommandName="SyndicateModule.Action"
IconFile="images/icons/rss16.png" DisplayIcon="True" DisplayLink="False" />
<dnn:ACTIONBUTTON runat="server" ID="dnnACTIONBUTTON3" CommandName="PrintModule.Action"
IconFile="images/icons/print16.png" DisplayIcon="True" DisplayLink="False" />
<dnn:ACTIONBUTTON runat="server" ID="dnnACTIONBUTTON1" CommandName="AddContent.Action"
IconFile="images/icons/action.png"
DisplayIcon="True" DisplayLink="False" />
<dnn:ACTIONBUTTON runat="server" ID="dnnACTIONBUTTON4" CommandName="ModuleSettings.Action"
IconFile="images/icons/edit16.png" DisplayIcon="True" DisplayLink="False" />
The images are correctly picked up from the container skin folder.
The problem with this however is that any IconFile specified in the skin/container overrides any icon that I specify in code when I add the actions:
public DotNetNuke.Entities.Modules.Actions.ModuleActionCollection ModuleActions {
get {
DotNetNuke.Entities.Modules.Actions.ModuleActionCollection Actions =
new DotNetNuke.Entities.Modules.Actions.ModuleActionCollection();
Actions.Add(GetNextActionID(), "Configure",
DotNetNuke.Entities.Modules.Actions.ModuleActionType.AddContent,
"", ModuleHomeDir + "images/Configure1_16.png",
ModuleContext.EditUrl("Configure"), false,
DotNetNuke.Security.SecurityAccessLevel.Edit, true, false);
return Actions;
}
}
If I remove the ImageUrl from the container skin, then the icon from my Actions.Add method is used.
This is a problem if an action/command is used more than once. Unusual with printing, but happens all the time with ModuleActionType.AddContent. For example, Hosts > Portals uses three actions with AddContent, specifying separate icons.
This is probably how it has worked for many releases, but it is odd that explicit icons from the Add method are overridden by the container skin. This makes it really difficult to replace standard icons, which is an absolute requirement for non-white backgrounds. The gif icons just don't look good on non-white backgrounds. For obvious reasons I don't want to replace the standard icons in the site's image folder.
Another complication is that the DNN:Actions menu uses the built-in icons (for print, settings, etc) and there appears to be no way to override these at all. (However, it does use icons added in code just fine).
Is there another solution to get me closer to what I'm trying to do, allowing me to override all the default built-in icons AND use some custom icons with Actions.Add? I understand I can replace the actionbutton with my own control which behaves differently, but I am hoping for a simpler solution.