Color Picker add on with CMSB v3+

3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: March 1, 2016   (RSS)

In case anyone else is using this addon, here are my results:

The big change here is making the addFilter an addAction on admin_head.  If you try to pass all of this into the ['CONTENT'] it appears to strip the javascript and styles out of it.  By putting it into the admin_head, it seems to preserve it.

I then had to add some changes to the styles

I needed to add

input.miniColors { width: auto !important; }

then, to miniColors-selector, i needed to add:

    line-height: normal;
    z-index: 100;
    box-sizing: content-box;

I had played around with a number of other changes that, in the end, were not really necessary, so I'm pretty sure these are the basic changes I needed to implement.

By Chris - March 1, 2016

Hi garyhoffmann,

I'm assuming you found the 'adminUI_args' plugin filter and were attempting to add html to $adminUI['CONTENT']? I thought your approach should have worked, so I tested it and found a small bug which was preventing plugins from being able to modify 'CONTENT' (and only 'CONTENT'). I've patched this bug and the fix should be in the release of CMS Builder after the next one (we're in the middle of releasing and I don't think I can get my patch in to 3.03.)

There's not really much documentation for the adminUI_args array yet, as it's brand new, however there are some examples of its use above the adminUI() function in admin_functions.php -- and you may find it helpful to search the codebase for calls to adminUI() to see how it's used. I hope this helps!

That said, "admin_header" (or "admin_footer") is probably a much better (simpler) hook to use in this case, as you're now doing.

Glad to hear you were able to get it working!

All the best,
Chris