Images into Table Cells

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

Just bought the software - I only understand the very basics so far. Typically, I use Joomla, but wanted to give this tool a try.

I am trying to make this page editable for a client :
http://hotfitnessyoga.com/schedule.htm

Currently, I am working under yoga.sitehook.com/schedule.php before I transfer it over to his web address.

He would like to be able to edit the time, and be able to move the images around in the table as his class times change.

I have gotten it to where everything is editable in a WYSIWYG Single Record section type. However, it's not very attractive. The first column is stretched way out.

Worst of all, I can delete the image in a cell, but it won't let me cut and paste it to somewhere else. I can only drag the image from one cell to another - and then it makes the cell height stretch.

Is there a way to set it up to where he can edit the text and simply copy and paste the image?

Thanks in advance for any tips,
Ashley

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: [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