Custom action icons in context menu not showing up
using umbraco v4.5
Checking a package for 4.5 compatibility seems to be working out pretty nice, just have a minor issue: I've created a custom action implementing IAction, setting Icon property as in:
public string Icon{
get { return "umbraco/memberGroup.gif"; }
}
yet don't see the icon in the context menu? Has that syntax changed?
I did try
public string Icon{
get { return "/umbraco/images/umbraco/memberGroup.gif"; }
}
but that doesn't do the trick either? Anyone knows how to set the path to the icon or am I taking the wrong approach now?
First code snippet works fine in 4.0.3 version, but won't in 4.5
Can't remember off the top of my head but your best bet would be to use Charles or Fiddler and see where the request is going. Perhaps just try memberGroup.gif ?
Sorry don't have source code with me at the moment so can't check :(
So this means that if the value of your string isn't a css class starting with a dot (everything in the backend is sprites by default) it'll use the images/ + what-ever-you-wrote to create the path to your image. BUT this doesn't work as you stated -> wwwroot/umbraco/images/umbraco/memberGroup.gif is a valid path, so I'm pretty sure someone forgot that package developers might want to use their own icons and not necessary sprites.
Dirk, you can help verify this if you look at the html source for your 4.5 contextmenu. Search for an ul with id="jstree-contextmenu" Your menuitem is a list item like:
Yes, you can define your own sprite but I think you would have to inject the styles into the existing umbraco css in order for the spirte to show. It might be possible to add a reference to your own stylesheet from within a custom section, but not sure it'll work outside of this section. Haven't really looked into the new dependency implementation yet :-S
background-image: url('url.jpg'); is only necessary if there is a space in the path, so... But I would say that it is the double quote that is causing the problem.
Custom action icons in context menu not showing up
using umbraco v4.5
Checking a package for 4.5 compatibility seems to be working out pretty nice, just have a minor issue: I've created a custom action implementing IAction, setting Icon property as in:
yet don't see the icon in the context menu? Has that syntax changed?
I did try
but that doesn't do the trick either? Anyone knows how to set the path to the icon or am I taking the wrong approach now?
First code snippet works fine in 4.0.3 version, but won't in 4.5
Cheers,
/Dirk
Can't remember off the top of my head but your best bet would be to use Charles or Fiddler and see where the request is going. Perhaps just try memberGroup.gif ?
Sorry don't have source code with me at the moment so can't check :(
Hi Dirk.
Did you find a solution to this problem ?
I'm also strugling with a context menu icon that will not show up in Umbraco v4.5.
/Søren Linaa
I couldn't help but look into this, as I also use custom actions in my packages but usally try to use existing icons for the contextmenu.
Looking at the source code for actions its the same as previous (taken from umbraco.BusinessLogic.Actions.Action);
So this means that if the value of your string isn't a css class starting with a dot (everything in the backend is sprites by default) it'll use the images/ + what-ever-you-wrote to create the path to your image. BUT this doesn't work as you stated -> wwwroot/umbraco/images/umbraco/memberGroup.gif is a valid path, so I'm pretty sure someone forgot that package developers might want to use their own icons and not necessary sprites.
Dirk, you can help verify this if you look at the html source for your 4.5 contextmenu.
Search for an ul with id="jstree-contextmenu"
Your menuitem is a list item like:
If the first div class looks like the following then my theory is correct :-)
- Morten
This is the output I get when providing the path to an images
In firebug, the &quote; appears as double quotes. Maybe it's this that is breaking it (double quotes inside double quotes)
Matt
Okay, so it is actually outputting inline styling. Which is a plus :-D
But yeah it should be:
- Morten
Hey Morten,
There is another post with some usefull information here:
http://our.umbraco.org/forum/using/ui-questions/6225-Custom-icon-in-Context-menu
Matt
Yes, you can define your own sprite but I think you would have to inject the styles into the existing umbraco css in order for the spirte to show. It might be possible to add a reference to your own stylesheet from within a custom section, but not sure it'll work outside of this section. Haven't really looked into the new dependency implementation yet :-S
But here is the problem:
Line 50 in jquery.tree.contextmenu.js
background-image: url('url.jpg'); is only necessary if there is a space in the path, so... But I would say that it is the double quote that is causing the problem.
- Morten
@Matt You wanna try out the fix? The file is located under wwwroot\umbraco_client\Tree\jquery.tree.contextmenu.js
Would be interesting to see if it actually works removing the two \" inside the ().
- Morten
Thought I'd add a link to another thread where Matt found a solution for the custom icon in contextmenu - umbraco 4.5:
http://our.umbraco.org/forum/using/ui-questions/6225-Custom-icon-in-Context-menu#comment39514
A codeplex issue has been added, so please go vote it up as its pretty important for Package developers to have this functionality.
http://umbraco.codeplex.com/workitem/28119?ProjectName=umbraco
- Morten
is working on a reply...