This fix nearly works, unfortunately it seems to still see the content
inside the div, and so adds another nested table with the same
row-per-element behavior.

I have a OK workaround, but any more tips welcome :)


On Tue, 2008-05-20 at 13:22 +0200, Dennis Dam wrote:
> 
> 
> Hey Tim,
> 
> you have the problem because the elements below are wrapped inside a
> <group/> element with type="columns". This will automatically make a
> two column row for each widget, where the first column contains the
> widget's label and the second contains the widget (e.g. a text input
> field in your case). Unfortunately, any other sub elements of a
> <group/> that are not considered group widgets (your DIV) are
> translated to one column row with colspan = 2. You can try to solve it
> by wrapping the textfield *and* the div inside another <group/>
> element with type="container". A container is also considered a widget
> when it's nested in another container. The first column however will
> then contain the nested group's label, and not the textfield's label!
> This is why you have to provide a label for the nested group. So your
> template will be sth like this:
> 
> <group type="columns"> 
>  <group type="container" label="my textfield"> 
>   <textfield id="/document/content/datum" /> 
>   <xhtml:div> 
>    <xhtml:span>TEST</xhtml:span>t 
>    <xhtml:img src="/cforms/resources/cal.gif"/> 
>   </xhtml:div> 
>  </group>  
> </group>d'
> 
> The label can also be an i18n key, so you can use the textfield's i18n
> key for that. 
> 
> Does this work like it should?
> 
> regards, 
> Dennis
> 
> -----Original Message----- 
> From: [EMAIL PROTECTED] on behalf of toolman 
> Sent: Mon 5/19/2008 1:54 PM 
> To: hippo-mailing-list 
> Subject: [HippoCMS-dev] Adding custom html to CMS layouts 
>   
> Hey guys;
> 
> as described here (http://www.hippocms.org/display/CMS/Template
> +editing 
> +tips) I am adding custom HTML tags.  Unfortunately, I have little 
> control over what gets placed, as it seems that every element is
> placed 
> in its own row.  My specific case:
> 
> 
> <textfield id="/document/content/datum" /> 
> <xhtml:div> 
>         <xhtml:span>TEST</xhtml:span> 
>         <xhtml:img src="/cforms/resources/cal.gif"/> 
> </xhtml:div>
> 
> Turns into:
> 
> <tr class="row-odd"> 
>         <td ...>Publication date</label></td> 
>         <td ...><input type="text" .../></td> 
> </tr> 
> <tr> 
>         <td colspan="2"> 
>                 <div> 
>                         <span ../> 
>                         <img src="/cforms/resources/cal.gif"/> 
>                 </div> 
>         </td> 
> </tr>
> 
> 
> So the problems are: 
> 
> 1) I wanted the div content to be in the same cell as the textfield
> but 
> there seems to be no way to do it. 
> 2) The generated TR that has my custom content doesnt get a 
> class="row-(odd|even)" so its not styled correctly.
> 
> Any tips?
> 
> ******************************************** 
> Hippocms-dev: Hippo CMS development public mailinglist
> 
********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Reply via email to