Help - Search - Members - Calendar
Full Version: Multiple Columns for (photo)blogs
Movable Type Community Forum > Additional Resources > Tips and Tricks
jenn99
Awhile back someone had asked about this here... and I wrote a javascript that will do this with a table rather than layers (for photologs, etc.)

The benefit to using this over CSS layers is that it is a bit more reliable with NS. (Especially NS4)

(please note you can change that "numColmax" number to be how ever many columns you want)
(This is assuming that you have your thumbnails specified in your excerpt area, and your "larger" image specified in your text area)
CODE
<script language="javascript">
<!--
// number of columns
var numColmax = 3;

var numCol = 1;
var done=false;
//-->
</script>
<table width="400" border=1 cellspacing=3 cellpadding=0>
<MTEntries>
<script language="javascript">
<!--
if (numCol == 1) {
document.write("<tr>");
}
//-->
</script>
<td>
<a href="<$MTEntryLink$>">
<$MTEntryTitle$>
<br>
<$MTEntryExcerpt$>
</a>
</p>
</td>
<script language="javascript">
<!--
numCol++
done = false

if (numCol > numColmax) {
 document.write("</tr>");
 numCol=1;
 done = true;
}
//-->
</script>
</MTEntries>

<script language="javascript">
<!--
if (!(done)) {
for (i=0; numCol <= numColmax; i++ )
{
document.write("<td> </td>")
numCol++
}
}
if ((numCol >= numColmax) && !(done)) {
document.write("</tr>")
}
//-->
</script>
</table>


let me know if that doesn't make sense, and I'll try to clarify it more...

-Jennifer
http://www.theworkingmom.net
sugarjunkie
Oh my gosh, thank you so much for posting this!  This is exactly what I was looking for.

THANK YOU!!! : )
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.