On 22 Dec 2005, at 11:28, David Baird wrote:

On 12/22/05, Kieren Diment <[EMAIL PROTECTED]> wrote:

I want to lay out my form myself in the template.  There may be a
neater way of doing it, but the default template encourages serious
uglieness:

<label><span class="field">[% item.project.name;
# this seems quite reasonable
%]
</span> [%
item.to_field(classmetadata.columns.0).as_XML;
#yuck why can't I reference by the name of the column?
%]

It would be better to be able to coerce classmetadata.columns into a
hash so I could refer to classmetadata.columns by column name.

Or will this be fixed in 2.11?


Use classmetadata.cgi instead of classmetadata.columns


Unfortunately it's not as straightforward as that, as classmetadata.cgi doesn't maintain state by itself; i.e:

[% dumper.dump_html(item.to_field(classmetadata.cgi.project)) ;
   dumper.dump_html(classmetadata.cgi.project.as_XML);
   dumper.dump_html(item.to_field(classmetadata.columns.0).as_XML);
%]

outputs (irrelevant bits removed):

$VAR1 = '';
$VAR1 = '<select name="project"><option value="6">MTO Analysis</ option></select>'; $VAR1 = '<select name="project"><option selected="selected" value="6">MTO Analysis</option></select>';




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel

Reply via email to