I've added a color-picked field to a taxonomy and want to the colors associated with the different terms in a view. I was hoping to get away with just doing this through the UI, without having to modify template files, etc.
I have a couple of suggestions for improving the formatters:
1) Make the "text" formatter output without the pound-sign prefix; it's always easier to add it back in by rewriting the field. Or give an alternate formatter, for backwards compatibility.
2) Improve the css classes assigned to the colored block formatter. Right now, it provides one ID and one over-specific class for the relevant div. I can't easily select *all* the colored block elements to resize them, in fac, to select them *at all* I need to know their color ahead-of-time. Adding some more generic classes to that div would be appreciated.
For myself, in the meantime, I'm going to have to add a css rule for each colour, for now. (Unless there's a better way that doesn't require me to learn php... heh. Suggestions, or code snippets welcome!)
Thanks for this module, BTW!
C.
Comment | File | Size | Author |
---|---|---|---|
#6 | all_entity_type_support-1488766-06.patch | 1.66 KB | plopesc |
Comments
Comment #1
cogno CreditAttribution: cogno commentedAs an aside, I'm getting the following notice when I add the colored block to a view:
Notice: Undefined property: stdClass::$nid in jquery_colorpicker_field_formatter_view() (line 335 of /home/cogno/public_html/sites/all/modules/jquery_colorpicker/jquery_colorpicker.module).
Any troubleshooting steps to suggest?
Comment #2
simg CreditAttribution: simg commentedI've got (had) the same problem applying this (great) module to a taxonomy term
I've hacked a fix by inserting the following line of code before line 335.
edit: since you don't know php - I'll point out that you don't include the line numbers when you cut and paste :)
Comment #3
plopescI included support for taxonomy_term entity and new classes for the formatter to make easier your theming.
Regards
Comment #5
AlcidesMorales CreditAttribution: AlcidesMorales commentedStill happen the same error in case of using Commerce and ($entity_type == 'commerce_line_item')
Comment #6
plopescHello
You're right, I forgot to improve the entity type support.
I made some test with the patch below and worked for me.
Could you try it and give me feedback?
Thanks for your interest in the module.
Regards.
Comment #7
plopescAfter some tests, the patch worked for me.
Marking as fixed.
Please, reopen if your problems persist.