customizer-library icon indicating copy to clipboard operation
customizer-library copied to clipboard

radio select options as images

Open bghouse opened this issue 10 years ago • 9 comments

I'm trying to figure out how to use images for my radio select options, like for instance when you are choosing layout options for a sidebar placement. Is this supported?

bghouse avatar Jun 29 '15 20:06 bghouse

This might help: http://justintadlock.com/archives/2015/06/04/customizer-radio-image-control

jamigibbs avatar Jun 29 '15 20:06 jamigibbs

@jamigibbs - well, maybe... phpstorm hates that JS template that's for sure.... it's a bit different from the existing and throwing me a bit here.... But basically it sounds like my answer is "no" and I need to figure this outside of the existing customizer library code, yes?

bghouse avatar Jun 29 '15 20:06 bghouse

Right, the customizer library makes it easier to apply core customizer options but doesn't go too far with custom settings (rightfully so, I think). You'd want to add your own as needed. I was planning on integrating this at some point into a theme I'm working on so I'll take a look and swing back here to let you know if I was able to.

jamigibbs avatar Jun 29 '15 21:06 jamigibbs

Thanks @jamigibbs - very much appreciated. Unfortunately I spent way to long on it today with my other deadlines, so I just made 12 options as text. I just know my boss is going to say "why cant we have images" - lol

bghouse avatar Jun 29 '15 21:06 bghouse

Ok. Well, if you still want some help with it, I can give some pointers. Justin has a nicer solution that I've managed to integrate:

https://gist.github.com/justintadlock/2a9e3312a6fe10e8dc28

jamigibbs avatar Jun 30 '15 21:06 jamigibbs

@jamigibbs - are you planning to integrate back up here to this library by any chance?

bghouse avatar Jun 30 '15 23:06 bghouse

I'm not sure that a pull request here is what Devin wants (to keep the library vanilla for other devs) so how about I just update my fork:

https://github.com/jamigibbs/customizer-library

Feel free to set yourself as watching so you get notified of changes and you're welcome to submit questions there if you'd like.

jamigibbs avatar Jul 01 '15 11:07 jamigibbs

There you go:

https://github.com/jamigibbs/customizer-library/commit/825805cbf9fd1a32abefa6edc420716892272ae9

jamigibbs avatar Jul 01 '15 15:07 jamigibbs

This is cool! I actually don't have too much of a problem adding additional controls if they are not too complex and will be used frequently.

The piece I might prefer to sheave off is the style-builder. Just thinking aloud...

devinsays avatar Jul 09 '15 20:07 devinsays