[Solved] Custom form and widget:description

A place for users and developers of the Xataface to discuss and receive support.

[Solved] Custom form and widget:description

Postby silma » Wed Apr 13, 2011 8:22 am

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 !
Last edited by silma on Thu Apr 21, 2011 2:29 am, edited 2 times in total.
silma
 
Posts: 87
Joined: Tue Apr 28, 2009 11:47 pm

Re: Custom form and widget:description

Postby shannah » Wed Apr 13, 2011 9:10 am

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

Re: Custom form and widget:description

Postby silma » Thu Apr 14, 2011 1:39 am

It's exactly what i needed

Thanks a lot !
silma
 
Posts: 87
Joined: Tue Apr 28, 2009 11:47 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 29 guests

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