Fields in two columns in edit / view mode?

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

Fields in two columns in edit / view mode?

Postby meta » Tue Jul 01, 2008 4:05 pm

Hi Steve,

is there an easy way to have the fields of one table in two columns in view/edit mode?

I see that the fields are listed in a table and every field is enclosed by an own div-Tag.

It seems to be quite a bit of work to do changing the plone.css which I don't want if I don't need it because it seems to be very perfect.

Can I do changes somewhere else to have a two column view / edit mode?
And why are all the textfields of database rendered as <td colspan="2" ...
as I saw in Dataface_QuickForm_element.html?
Which templates do I have to change to get the desired two-column layout without destroying something else?

Thank you
Markus
meta
 
Posts: 30
Joined: Mon Nov 12, 2007 8:30 am
Location: Berlin, Germany

Postby shannah » Wed Jul 02, 2008 9:51 am

There are 2 templates that deal with form rendering.
1. Dataface_Form_Template.html
2. Dataface_Form_Section_Template.html

You'll probably want to override the second one if you want to make changes across the board.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby inmisia » Thu Jul 02, 2009 3:08 am

For doing this I have add to Dataface_Form_Section_Template.html
from line 11
Code: Select all
         {foreach from=$elements item=element name=CicloPrincipale}
         
            {*
               #04 - Render Element
               ------------------------------
               This section is used to render an element to be displayed.
            *}
            
            {block name="before_`$element.field.name`_row" table=$element.field.tablename}
            {define_slot name="`$element.field.name`_row" table=$element.field.tablename}
            
            {if $smarty.foreach.CicloPrincipale.iteration % 2 == 1}
             <tr id="{$element.field.name}_form_row" >
            {/if}
            
   


and at line 176
Code: Select all
{if $smarty.foreach.CicloPrincipale.iteration % 2 == 0}
            </tr>
            {/if}


Add name for main cicle and if for put or not put tr tag, for more of two column
change % 2 to % number of column...

Sorry for my wast ItalianEnglish!!
inmisia
 
Posts: 16
Joined: Tue Nov 06, 2007 2:01 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 27 guests

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