Forum OpenACS Development: Time for a new default form template?

Collapse
Posted by Ola Hansson on
Although I know it's been discussed already, I would like to propose that we change the default form builder-template in favour of "standard-lars".

Lars' "standard-lars" template is the one that is being used here on openacs.org when we submit postings, bugs, etc. IMHO it's much prettier than the blue "standard" template (which is the default one used in, I would estimate, 95 percent of all forms in the toolkit).

It is "cleaner" than the blue one and better separates the elements. It also does not use <TD nowrap> which the blue does (very annoying).

The only complaint I have with standard-lars - and it applies to the blue template too - is that the element label ought to be valigned to the top. It's irritating to have to scroll down in order to read what the element is about if it contains a bulky text.

It would be pretty easy to rename the standard template to "standard-blue" (say) and then rename standard-lars to "standard", wouldn't it?

Anyway, all in all I think it is a way better default than the current "standard" template.

Collapse
Posted by Jim Lynch on
Four words: why break existing code?
Collapse
Posted by Don Baccus on
It wouldn't break existing code, just change the layout of forms in a way that many of us think is more attractive.
Collapse
Posted by Dave Bauer on
Jim,

By renaming the default template, existing code will work exactly the same, but the templates will look a little nicer.

That is the idea of a default form template :). All the forms use the default and no code needs to be changed, but you can easily change the look of every form by changing the default template.

Collapse
Posted by Jim Lynch on
Just asking :) if it doesn't break any code, let's have the prettier one :)
Collapse
Posted by Don Baccus on
Actually ... the default form template ought to be a parameter to acs-templating, making it easy to change system-wide without having to munge files.  Among other things install.xml could change it if a vertical application author/bundler wanted to provide their own ...
Collapse
Posted by Tom Jackson on

Could the default be altered on a package instance basis, kind of like the default-master?

Collapse
Posted by Bart Teeuwisse on
Tom,

default templates on a per package basis backed by a master default is possible like so:

[ad_parameter default_template -default [ad_parameter -package_id [apm_package_id_from_key acs-templating] default_template]]

I've used this principle in the authorize-gateway package so that calling packages can rely on the master defaults of the gateway or choose to overide those parameters.

/Bart

Collapse
Posted by Malte Sussdorff on
Well, while we are at it, would you mind setting up a repository for templates. This way we could distribute SKINs with OpenACS. I know it is cheap, but still, it will do the marketing trick, pretty sure about it. (Easy to setup, multiple skins available at a fingertip, bla, blub, blubber).
Collapse
Posted by Lars Pind on
I obviously support this.

FYI, There already is a parameter to acs-templating called "DefulatFormStyle", which I added to 4.6.2 because I wanted the events registration package to use standard-lars, and didn't want to hack all the pages manually.

This is only a site-wide setting, though.

/Lars

Collapse
Posted by Ola Hansson on
Ah, I missed that.

Then the easiest thing to do maybe is to change the default of that parameter to "standard-lars" instead of "standard" in acs-templating.info?

Collapse
Posted by Don Baccus on
Lars, you sneaky bastard, putting that parameter into 4.6.2!  Good job!

Now ... it's also easy to write a standard form template that flags mandatory fields, very useful in some contexts (I did this for Greenpeace)

Would it be worthwhile adding a form option to do this flagging that would then be honored by our form templates?

Malte - yes, a "skins" repository is a good idea.  These good ideas just need a champion to volunteer to set up, document (we'd need a "how to write a skin" doc) etc to get implemented.

Collapse
Posted by Tilmann Singer on
Regarding the visual indication for mandatory fields: excellent, that's very userfriendly.

But do we really need yet another form flag for that - why not just make it dependent on the already available 'optional' flag for the widget datatype?

Collapse
Posted by Roberto Mello on
While we're going to change, I remind others that I CSS-ized standard-lars a while ago. It is probably lacking a bit behind Lars' latest changes to the form builder though.

It's available at http://www.brasileiro.net/code/ (which has only one item).

-Roberto