Checkbox in custom template

Archived from the Xataface Developers forum.

strast — Tue Feb 17, 2009 11:47 am

Hello

I was pleased to find in my email, the link to the document describing the use of the fieldgroup directive in the fields.ini and how to access a Smarty template in that fieldgroup definition.

I’ve set up such a group, which contains a field of type INT(1).

In the fields.ini, I had it set as widget:type=checkbox which worked fine. However, in the MyFieldGroup.html file, using the example syntax shown as: <td>{$elements.home_address_flag}</td> it simply displays the text “Array”.

How do I format my table data element to render a working checkbox?

..Steve


shannah — Tue Feb 17, 2009 1:21 pm

Try

Code: Select all
{$elements.home_address_flag.html}

instead of just

Code: Select all
{$elements.home_address_flag}

The {$elements.home_address} variable is actually a structure that contains a all of the information about the field. The ‘html’ attribute of this structure contains the actual html for the checkbox.


strast — Tue Feb 17, 2009 1:36 pm

Thanks Steve.

I caught that just a few minutes ago myself.