Forum OpenACS Q&A: Form builder

Collapse
Posted by Hazi Gharagozlou on
On a recent thread Don mentioned that he wants all new developement
to use the Form Builder and he was working on a tool to make it
templatabale.

Do I undestand that with form builder we are talking about
Template::Create Form and its related element creation procs? If yes
can you suggest certain guidelines so I don't have to come back and
change a lot of pages?

Collapse
2: Response to Form builder (response to 1)
Posted by Don Baccus on
Actually the form builder's been templatable all along. You can supply a "style" argument to the formtemplate tag. If you want to see the template that builds the standard ugly (IMO) "blue pad" style form check out acs-templating/resources/forms/standard.adp.

I hadn't realized how few people raalized that forms are templatable (awkwardly in that it wants your form template to be in that directory). Because of that I've been trying to get the word out.

You can also build a form directly using forwidget and related tags within your formtemplate tag. This gives full control over the page.

But writing a template of your liking and using it consistently with the "style" param to formtemplate when possible is probably best.

What I have been working on is an "ad_form" proc in the style of "ad_page_contract". A preliminary version is working, I've actually used it on a page I wrote a few days ago for a client project. I plan to put this initial version into the development branch of CVS over the weekend, and will make an example available. This first check-in will be short on documentation and also short on functionality (compared to my eventual goals) but should be immediately useful to folks.

I'll also add a couple of alternative templates to the resources directory, and if I have time fix a couple of the ones that are already there but broken.

Collapse
3: Response to Form builder (response to 1)
Posted by Hazi Gharagozlou on
Don wrote

I hadn't realized how few people raalized that forms are templatable (awkwardly in that it wants your form template to be in that directory). Because of that I've been trying to get the word out.

At least for me the lack of documentation and examples (sample page is just not good enough) are to be blamed for not realizing the full potential of templating. From the discussions in this forum I get the impression that only the initated few use templating. Maybe I am wrong. Anyway if this summer I have the time and have come to full grips with templating I will write a primer and posted here.

But writing a template of your liking and using it consistently with the "style" param to formtemplate when possible is probably best.

I have tried to use template::form::template/generate "id" "stylesheet" to no avail. Can you help.

I am using the released beta version.

Collapse
4: Response to Form builder (response to 1)
Posted by Don Baccus on
First of all, don't feel bad at not discovering this feature.  I knew it was there, having followed the design and implementation of the ATS when aD was publishing stuff.  It was a standalone system and integration with the ACS was an afterthought (which my cynical mind presumes to be "they lost the battle to replace the ACS with their own vision", but that's not important, true or false).

Anyway ... my point is that I've known forever that it's templatable but had never sat down to work out an example until recently, because I hadn't seen any.  And it hurts to add that there are additional templates in the OpenACS 4.5 core that don't work (they didn't work in ACS 4.2, either).

The bright side - over the next few ... months?  weeks? (if we're lucky) more examples will be forthcoming buth showing how to use the old API and also my "ad_form" wrapper.  InfiniteInfo and Musea have also been working on tools to build form handlers from object definitiosn (for ETP).

Expect progress in this area over the next several weeks ... it's important ... and I'm sure it will happen.

Collapse
5: Response to Form builder (response to 1)
Posted by Talli Somekh on
Don Baccus said: " The bright side - over the next few ... months? weeks? (if we're lucky) more examples will be forthcoming buth showing how to use the old API and also my "ad_form" wrapper. InfiniteInfo and Musea have also been working on tools to build form handlers from object definitiosn (for ETP)."

Just for accuracy's sake, Dave Bauer will be working on ETP2 in addition to Jun Yamog from Infinite Info and Luke Pond from Musea. In fact, Dave might even have a chance to get to the code before either Jun or Luke do. Contrary to his own modest assessment, Dave knows the OACS4.5 just about as well as anyone now.

Hazi, if you're interetsed in chatting about this stuff, you can find Dave in the OACS irc channel pretty regularly. It's at #openacs on irc.openprojects.net

talli

Collapse
6: Response to Form builder (response to 1)
Posted by Don Baccus on
Oh, I didn't know Dave was working on it.  Cool.  Thanks for the correction.
Collapse
7: Response to Form builder (response to 1)
Posted by Lars Pind on
I recently created my own form template (which I'm in the process of further modifying), and found it pretty hard to figure out what's going on. The details eludes me now, but I think there were a lot of form builder hooks (e.g. for form errors), and there's a bunch of noparse tags, etc.

Don, is writing templates for the form builder just notoriously hard? Are we simply lacking good documentation? Or is there a way to simplify writing form templates?

Collapse
8: Response to Form builder (response to 1)
Posted by Lars Pind on
... I meant *inherently* hard ...