[% IF OrgType.id == Organization.org_type_id %]selected="selected"[% END %]
Does not work even when they both evaluate to the same number.
[% IF OrgType.id == 3 %]selected="selected"[% END %]
(i.e. hard-coding in a number for testing purposes) does work.
[% OrgType.id %] and [% Organization.org_type_id %]
both print “3” on the page.
The following works for me:
That outputs ‘blah’. So I suspect that your two variables don’t contain what you think they do. Template Toolkit uses string equality for
==, so if you do:It will break. You may need to massage the data a bit to get them to work right with string equality.