Forum OpenACS Q&A: Re: template::list::create adding a class to the <tr>

Collapse
Posted by Antonio Pisano on
Hello Tony,

template::list doesn't enforce the use of an HTML table to represent the list graphically, because the actual tags used are decided by the adp template. For this reason, the options you mention don't address tr or td tags directly, but of course they could, if the list is built using a table in the end.

More specifically to your point, in a list we can agree there are at least 3 generic parts we could have displayed with a particular class: the list itself, the row and the column (note that I didn't mention any tag here). Ideally we would have 3 options, that could be 'class', 'row_class' and 'col_class'. template::list should just store their values and make them accessible in the template, as again their use will happen only in the adp.

I didn't check the actual use of the current class options in the vanilla adp OpenACS ships. One could tweak them to do what he wants (as you did) and decide one is for row and the other is for col, but if you read the docs looks like all the three class options are just meant for the list: one can specify the class the list is displayed with both directly ('class' option) or by joining 'main_class' and 'sub_class'. [1]

Personally I don't think other two options for the row and column class will hurt anybody, as long as they default to the current value when not specified, so I could suggest you to come out with your patch proposal, file a bug and attach it.

All the best
Antonio

[1] http://www.openacs.org/api-doc/proc-view?proc=template%3a%3alist%3a%3acreate&source_p=1