On Tue, Apr 12, 2011 at 1:39 AM, Dave Howorth
<[email protected]> wrote:
> Larry Leszczynski wrote:
>> I think you can do:
>>
>>    IF items.list.size > 0;
>>
>> See:  http://template-toolkit.org/docs/manual/VMethods.html#section_list
>
> Hi Larry,
>
> Tried that one too :( If items is a single object, .list is the hash
> vmethod and .size just tells you how many attributes there are.

Hi Dave,

Check what version of Template Toolkit you are using.  This was
something that was changed in v2.20:

* Applied a patch to Template::Stash from Jess Robinson which allows you
  to call a list method on a single object and have it automatically
  upgraded to a single item list.  Changed the XS Stash to do the same.
  http://lists.tt2.org/pipermail/templates/2006-November/009115.html

Cheers,

Cees

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to