getting custom fields to display in the buglist css classes

David Miller justdave at bugzilla.org
Tue Feb 6 16:28:36 UTC 2007


David Miller wrote on 2/6/07 11:21 AM:
> You've already got 'field' there in the loop, you don't need to
> dereference Bug to get at it.  There

oops, I sent that prematurely...  what I was trying to say was are you
trying to get at the value of the field rather than the name of it?
Looks like it's the same AUTOLOAD method to get at it so that ought to
work...  there may be some limit to the number of things you can stuff
in a class field and have the browser notice it, too.  Have you looked
at the generated source after running that?  I seem to recall that some
browsers only look at the first 8 things in a class attribute.

> Bill Barry wrote on 2/6/07 10:53 AM:
>> I am trying to get custom fields to show up inside the class attribute
>> of the table row in buglist.cgi (I'll file a bug when I get something
>> working), but I am unable to get the values.
>> It appears that bug.${field.name} is always empty inside this template.
>> Am I doing something wrong?
>>
>>
>> Index: template/en/default/list/table.html.tmpl
>> ===================================================================
>> RCS file:
>> /cvsroot/mozilla/webtools/bugzilla/template/en/default/list/table.html.tmpl,v
>>
>> retrieving revision 1.32
>> diff -u -r1.32 table.html.tmpl
>> --- template/en/default/list/table.html.tmpl    20 Oct 2006 15:50:58
>> -0000      1.32
>> +++ template/en/default/list/table.html.tmpl    6 Feb 2007 15:49:31 -0000
>> @@ -164,6 +164,13 @@
>>              bz_[% bug.bug_severity FILTER css_class_quote -%]
>>              bz_[% bug.priority FILTER css_class_quote -%]
>>              bz_[% bug.bug_status FILTER css_class_quote -%]
>> +             [% USE Bugzilla %]
>> +             [% fields = Bugzilla.get_fields({ obsolete => 0, custom =>
>> 1 }) %]
>> +             [% IF fields %]
>> +               [% FOREACH field = fields %]
>> +                 bz_[% field.name FILTER css_class_quote %]_[%
>> bug.${field.name} FILTER css_class_quote -%]
>> +               [% END %]
>> +             [% END %]
>>              [%+ "bz_$bug.resolution" FILTER css_class_quote IF
>> bug.resolution -%]
>>              [%+ "bz_secure" IF bug.secure_mode -%]
>>              [%+ "bz_secure_mode_$bug.secure_mode" FILTER
>> css_class_quote IF bug.secure_mode -%]
>>
>> -
>> To view or change your list settings, click here:
>> <http://bugzilla.org/cgi-bin/mj_wwwusr?user=justdave@bugzilla.org>
>>
> 
> 


-- 
Dave Miller                                   http://www.justdave.net/
System Administrator, Mozilla Corporation      http://www.mozilla.com/
Project Leader, Bugzilla Bug Tracking System  http://www.bugzilla.org/



More information about the developers mailing list