You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark Lundquist <ml...@wrinkledog.com> on 2004/02/14 17:58:48 UTC

[woody question] Is there a better way?

Hi,

I have a form that needs to include some elements that were not 
generated from widgets.  Here's what I need to generate, from my woody 
template:

                     <input type="file" name="logo-file"
                       onchange="document.forms[0].submit()" />
                     <div>
                       <img src="${logoURI}" />
                     </div>

I know that if I switch to 2.1.4, I would get a <wd:upload> widget to 
generate the <input type="file">.  But be that as it may, I still need 
my image preview there with it.  But I couldn't find any way for the 
woody stylesheets to "pass through" elements that need to be included 
in (for instance) the table generated by the group-columns-output mode.

So here's what I did: I added this new "<wi:custom>" element to 
woody-field-styling.xsl:

   <xsl:template match="wi:custom">
     <xsl:apply-templates select="*[not (self::wi:label)]" />
     <xsl:call-template name="woody-field-common"/>
   </xsl:template>

And then in my template file I write:

                 <wi:custom id="logo">
                   <wi:label>Logo</wi:label>
                     <input type="file" name="logo-file"
                       onchange="document.forms[0].submit()" />
                     <div>
                       <img src="${logoURI}" />
                     </div>
                 </wi:custom>

Seems to work fine.  So my question is: am I missing something?  Was 
there an out-of-the-box way to do this, and I'm just not seeing it?  
Or, by chance, is there an out-of-the-box way in 2.1.4 but not 2.1.3?

-- Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org