use CSS rather than HTML to include images
| Project: | Context links |
| Version: | HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
I love this module and I've used it for over two years. So first of all, thanks for all the good work.
My minor problem with it is that it includes an IMG tag in front of every link class that has an image associated with it. I would think that this is much "cleaner" to do with css? Since you already SPAN all links with appropriate classes, wouldn't it be "cleaner" to dynamically generate the appropriate CSS file through the admin UI?
For example, I use the following in contextlinks.css:
.contextlinks-ext a {
background: url(images/extlink.png) right center no-repeat;
padding-right: 12px;
}
Of course, the position of the image (before or after the link) as well as the padding could be changed in the admin UI, saved in the database / contextlinks table, and a CSS file generated from it.
I admit to usually simply hacking contextlinks.module to omit the IMG tag and then adding the appropriate css information for the classes I need, but if you would consider switching over to css, I might give a proper patch a try.
Any feedback?
-- telcontar
