Forum OpenACS Q&A: Newbie adp template question

Collapse
Posted by Ayman M on
Hi,

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: http://208.184.248.90/doc/acs- templating/demo/

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

Thanks
Ayman
Collapse
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...