Page 1 of 1

Fields in two columns in edit / view mode?

PostPosted: Tue Jul 01, 2008 4:05 pm
by meta
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

PostPosted: Wed Jul 02, 2008 9:51 am
by shannah
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

PostPosted: Thu Jul 02, 2009 3:08 am
by inmisia
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!!