I need to detect some variable for accessory to array type in Template toolkit. Are there best practices?
Your data should be validated by the controller BEFORE it's passed to the template. There should be no mystery what format your data is in.
That said, the most useful method to check this would just be testing the array
's size:
[% IF var.size %]
[% END %]