Hello,
(This question is about OpenACS 5.2.3.)
I'd like to add another parameter/value pair (called "pos-group", similar to "section" to some form elements, to allow me to alter display on some elements. (I thought it made more sense to do this than create a whole pile of new widgets, but maybe I was wrong.) I set out to essentially duplicate the code in the templating system that handles sections.
So I changed:
acs-templating-init.tcl to add a default value for pos-group.
In template::element::create, I added
set opts(pos-group) $form_properties(pos-group)
to duplicate what I saw for section. However, when I added some ns_logging, I got blank values for both $form_properties(section) and $form_properties(pos-group), even when I had a section set (and displaying properly in the form).
I duplicated template::form::section to make template::form::pos-group, but the ns_log statement I have in both template::form::section and template::form::pos-group doesn't seem to be appearing.
I looked at ad_form but didn't see anything specific to the -section flag there, so I didn't make any changes. (I did see:
foreach element $form {
set element_name_part [lindex $element 0]
# This can easily be generalized if we add more embeddable form commands ...
if { [string equal $element_name_part "-section"] } {
lappend af_element_names($form_name) "[list "-section" [uplevel [list subst [lindex $element 1]]]]"
ns_log notice "CAS found a section!"
} else {
set element_name_part [uplevel [list subst $element_name_part]]
..but I don't think this is the same "section", as I never saw the first part get invoked when I added some ns_log statements.
I've reloaded, I've watched files, I've restarted the server, but I'm stumped. Setting a section works just fine in practice, and yet I can't see it getting set in my ns_log statements, which makes me wonder if I'm totally missing some proc where the work actually gets done.
Any pointers?
Thanks!