Simone Gianni wrote:
Hello,
I've been working with CForms for more than a year, and always ended up
overriding the default XSLs to add CSS classes and obtain proper
formatting.
I think it could be a good idea to have CSS classes applied by the
default XSLs to make it easier to have forms look correctly, and avoid
to the user the need to write his own XSL just to get simple visual
effects, like the right spacing between labels and inputs. Currently
only error messages, tabs, the required mark and the double list have
their CSS class declaration.
I've done this before, I can produce a patch for it, let me know if you
think this is a good idea or not.
First off: the idea is great. But don't stop with just adding CSS
labels. Use the opportunity to remove superfluous tables and make better
use of CSS. However, I've tried before and here are the issues I ran into:
- proper usage means a <label for="input-id">label text</label><input
id="input-id"/>. When I was working on this, not all fields had a label.
Mind you, not every widget can.
- current AJAX functionality requires extra DIVs to be able handle the
update.
- you can add a default kind of styling like "columns" and "rows" to get
vertically or horizontally oriented styling. To be compatible, you need
to either add enough classes the XSL adds the proper class, or you
define meaningful classes and style them differently in different CSS
files. I prefer the last.
- it would be great if you removed the table-layout (of the default
styling) as well. But beware that it's a tough job.
- some widgets (e.g. double list) are very tough to change to something
other the current table.
Thanks.
Bye, Helma