Page 1 of 1

[Solved] Custom form and widget:description

PostPosted: Wed Apr 13, 2011 8:22 am
by silma
Hello Steve & Xataface users,

I'm a bit ashamed, because the answer to my question must be really simple, but i didn't find it in the wiki or the forum.

I'm using a custom template with a forms.
I'd like to display the "widget:description" content in my template, is there something in the $elements array that could permit me to do it ?

I know i could just copy it in the template but i'm looking for a more "MVC" way to do it..

In my fields.ini file I've got :

Code: Select all
[fieldgroup:Usage]
label="Utilisation"
template="MyCustomGroup.html"
order=2
section:order=2

[Date]
widget:label = "Date"
widget:description = "Date de saisie (au format JJ-MM-AAAA)de ce formulaire."
validators:date = true
validators:date:message = "Le champ Date  doit ĂȘtre une date."
validators:required = true
validators:required:message = "Merci de remplir le champ Date"
widget:ifFormat="%d-%m-%Y"
order=3
group="Usage"




and in MyCustomGroup.html file :
Code: Select all
<table class="record-view-table" width="100%">
    <tr>
      <th>Date : </th>
      <td>{$elements.Date.html} <span class="fieldRequired" title="required" style="color: #ff0000"></td>
      <td>HERE I'd like to have the description</td>
    </tr>

</table>


Thanks a lot for you help !

Re: Custom form and widget:description

PostPosted: Wed Apr 13, 2011 9:10 am
by shannah
{$elements.Date.field.widget.description}

If you want to see some more examples of what's available, check out the default form section template:
http://weblite.ca/svn/dataface/core/tru ... plate.html

-Steve

Re: Custom form and widget:description

PostPosted: Thu Apr 14, 2011 1:39 am
by silma
It's exactly what i needed

Thanks a lot !