Images into Table Cells

4 posts by 2 authors in: Forums > CMS Builder
Last Post: March 12, 2009   (RSS)

Re: [Ashley1985] Images into Table Cells

By Dave - March 11, 2009

Hi Ashley, welcome to the CMS Builder forum! :)

There's a few ways to do it. Schedule grids like this are notoriously challenging for a variety of reasons. Even editing tables in a regular word processor can be difficult for many end users.

One way to do it is to have a single page editor with checkboxes for each time. If you want to let him change the time you could have textfields for Time A, Time B, etc. And then checkboxes for:
Monday Time A [ ]
Monday Time B [ ]
etc.

If you want to try the wysiwyg method some more here's some tricks with that. You can copy and paste an image by copying it (ctrl-c) and the clicking the "Paste from Word" button and pasting it in there. Not easy but possible.

You can also turn off that automatic "paste as text" feature by editing /cmsAdmin/lib/wysiwyg.php and commenting out these two lines (add the text in red):

//paste_use_dialog: true,
//paste_auto_cleanup_on_paste: true,

That will make it so you can copy and paste without the popup.

Hope that helps, let me know how it goes.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Images into Table Cells

Commenting out those two lines worked perfectly. Thank you so much!

As far as the single page editor with checkboxes, how does that work? Instead of the image, there would be a checkmark? Or is that customizable?

Is there a way for the backend user to put a checkmark, but for it to appear as the image on the website?

Thanks again for answering so quickly!

Re: [Ashley1985] Images into Table Cells

By Dave - March 12, 2009

Hi Ashley1985,

Yes, basically if you had a checkbox field in the editor called "monday_morning_time_a" then you could have this in the code:

<?php if ($record['monday_morning_time_a']): ?>
... code to show image here ...
<?php endif ?>

This tests to see if the checkbox is checked and only shows the html or code inside the if/endif if the checkbox _is_ checked.

Hope that helps, let me know if you need more details.
Dave Edis - Senior Developer
interactivetools.com