cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Koberg" <...@koberg.com>
Subject RE: [RT] the quest for the perfect template language
Date Thu, 03 Apr 2003 21:26:13 GMT


> -----Original Message-----
> From: Stefano Mazzocchi [mailto:stefano@apache.org]
> Sent: Thursday, April 03, 2003 1:06 PM
> To: cocoon-dev@xml.apache.org
> 
> Robert Koberg wrote:
> > Hmmm... You seem to be making this much more complex than it needs to
> be.
> >
> > Why not do something like this:
> >
> > XSL:
> > <xsl:template match="fotografie">
> >   <xsl:apply-templates/>
> > </xsl:template>
> >
> > <xsl:template match="foto">
> >   <div class="thumbnail" onclick="expandImage()">
> >     <div class="imageContainer">
> >       <img src="{@id}" class="img"/>
> >     </div>
> >     <div class="description">
> >       <xsl:apply-templates select="."/>
> >     </div>
> >   </div>
> > </xsl:template>
> >
> > CSS:
> > .thumbnail {
> > display:inline;
> > margin:10px;
> > }
> >
> > .imageContainer {
> > padding:3px;
> > border:1px solid blue;
> > }
> >
> > .img {
> > width:20px;
> > height:20px;
> > }
> >
> > .description {
> > font-size:80%;
> > padding:10px;
> > }
> >
> > With this you can have you gallery have the columns fit the width of the
> > (resized) window and they will wrap when necessary. Perhaps I am missing
> why
> > you need the complexity?
> 
> Because I need a 'matrix' of thumbnails, with the number of columns in
> this matrix/table to be customizable. Your stylesheet generates only one
> column all the time.

No, it creates one long row that will wrap based on the width of the browser
window or perhaps a container DIV, using display:inline.

.thumbnail {
* display:inline; *
margin:10px;
}

Or perhaps you need to set the columns and rows per page view? If so, I
would still use CSS for layout and limit the thumbnail count in XSL. You
just need to know the number of thumbnails (and which ones) to show and set
a class on a DIV that wraps all thumbnails to certain width to get the
correct number of cols and rows. 

Best,
-Rob

> 
> Stefano.


Mime
View raw message