Checkbox in custom template

A place to discuss development of the Xataface core.

Checkbox in custom template

Postby 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
strast
 
Posts: 29
Joined: Thu Feb 05, 2009 6:14 pm

Postby 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.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Doh

Postby strast » Tue Feb 17, 2009 1:36 pm

Thanks Steve.

I caught that just a few minutes ago myself.
strast
 
Posts: 29
Joined: Thu Feb 05, 2009 6:14 pm


Return to Xataface Developers

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved