This is to basically add a wrapper to the icon if necessary to achieve specific styling configurations like fancy icon only headers, etc.
![]()
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | allow_icons_to_be_wrapped-2311285-3.patch | 18.46 KB | markhalliwell |
This is to basically add a wrapper to the icon if necessary to achieve specific styling configurations like fancy icon only headers, etc.
![]()
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | allow_icons_to_be_wrapped-2311285-3.patch | 18.46 KB | markhalliwell |
Comments
Comment #1
kyletaylored commentedPatch attached.
Comment #2
markhalliwellOverall, I generally like the idea :) I do think it needs a little bit of work though to make it more robust:
Helper functions are only really ever useful if it helps to reduce duplicitous code or one can see the potential of it being used very often. In this particular case though, I would suspect that it's only ever going to be used in this one spot. The code should just be moved to where it's being implemented.
I would like to take this a step further though and argue that we shouldn't look at wrapping just the icon_block module. I could see this being something that many people would want to/could use in all of them.
Perhaps we should, instead, look at generalizing this as a wrapper inside the
theme_icon()function itself and extending the form/element settings to include this as a whole.If not used, remove.
Whitespace.
Generally speaking, avoid markup like this. Use render arrays; this is the future of D8. Using render arrays allows elements to be preprocessed and avoids things being "set in stone" on the front-end. In this particular example it should have probably looked something more like:
Comment #4
markhalliwellI made the wrapper/wrapper class variables part of the
icontheme hook itself. I also moved the configuration to theicon_selectorelement so it shows up on all forms now.