Colored Panels within Editor
5 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: April 8, 2013 (RSS)
By Mikey - April 7, 2013 - edited: April 7, 2013
I'm interested in building a plugin that would allow me to color coat sections within the editor of a page as seen within the attached snap shot. I'm not sure if this is even possible to do. Anyone have any suggestions or feedback on if this is possible and if yes - where to start?
By Dave - April 8, 2013
Hi zick,
That's interesting. How do you want to determine which colors are associated with which section?
I think the easiest way to approach it would be by user jquery to loop over the table rows and change the background color on each. And then have a CMSB plugin that adds the jQuery code to the footer.
Still could be a bit tricky, though. Let me know any questions.
interactivetools.com
By Toledoh - April 8, 2013
Depending on how often you're going to use it... could you add a separator before and after the the section you want coloured. with a <div style="background:red;"> first, then 2nd separator with </div>?
Tim (toledoh.com.au)
By Mikey - April 8, 2013
Yea I was thinking some jQuery may do the trick, but I can see where it would be tricky after viewing the source code of one of my records and how the tables are nested. I can see where depending on what types of fields are created - per site it could through the entire thing out of wack.
I briefly considered the idea of making the jQuery set the background:#color to some kind of color that loads into the table, tr and td - and remains as that color until there's an instance by which a new color is assigned to the table, tr and td. But how do you determine the break from one background to the next is the question, since each site may have unique fields.
I'm just thinking out load here, but...May some why for the jQuery to query the MySQL to look for a record's fields (cms_colorBreak), then within the plugin, you assign your total number of #colors and have jQuery load it into the page - based on where you have created the record's field (cms_colorBreak).
By Mikey - April 8, 2013
Yea I actually tried that the other day, before my post to the forum, but was unsuccessful getting it to work.