Forum OpenACS Q&A: Newbie adp template question

Posted by Ayman M on

I am currently trying to understand how the templating system works and how to use it and i found some sample code but when I tried copying the same structure I got errors.

Eg. Sample code:

element create sandwich grid
-label "grid" -optional
-datatype text -widget hidden

I got an error which complained about -label being an invalid command name.

To fix this, I had to put it all on 1 line such as:
element create sandwich grid -label "grid" -optional -datatype text - widget hidden

Any ideas why this is the case?

I saw the examples at: templating/demo/

Are there any other places I can read to learn more and see more examples about the templating system.

Posted by Michael A. Cleverly on
You need to make sure there is no extra-whitespace between the backslash after "element create sandwich grid" and the newline.

Looks like the bboard (postgres driver actually) ate the backslash in your post above (though it was in the email alert).  But you've got the right idea (and it's how I do it--I find the multiple line layout to be much more readable than cramming everything on one line)--just make sure there isn't a trailing space lurking...