Jump to content

This topic is 7935 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Is it possible to format your results so that you can have your results pull up in 2 columns ? I am working on a photo database. my search page pulls up small thumbnail photos. I would like the results to pull up rows of photos instead of each row with just one photo. Is that possible and if so could you share the code with me. (I am a newbie, and don't know too much yet).

Thanks for your help !

Posted

maybe...:

<td height="20">

[FMP-Record]

[FMP-field: FieldName] .:.

[/FMP-Record]

</td>

where you would have one table(html)row, and all the data-filed-images in that row but I would imagine this to be hard to control design-wise

give it try...

Posted

Here you go:

<table><tr>

<script>i = 1 ; nCols = 2 ;

[FMP-Record]

if ((i % nCols) == 0)

   { document.write("<td>[FMP-Field:myimage]<br>[FMP-Field:imagename]</td></tr><tr>") ; }

else

   { document.write("<td>[FMP-Field:myimage]<br>[FMP-Field:imagename]</td>") ; } ;



i++ ;[/FMP-Record]

</script></tr></table>

All the best.

Garry

Posted

thanks, for the help. I couldn't get it to work with my database. I think it may be because the way I linked my pictures from the database. I put thumbnail photos inside the database which on the results page link to a detail page which has a field which has the URL to link to larger photos. I imagine there is a better way to do this. I just tried different things until I got it to work. I will try to attach my database. Can you take a look ?

Posted

Try this:

        <TR>

           <script>i = 1 ; nCols = 2 ; 

[FMP-Record] 

if ((i % nCols) == 0) 

   {

   document.write("<td width='156' valign='top'><img src='[FMP-Image:Photo]' border='1'></td>");

   document.write("<td>[FMP-FIELD: picname]<br>Type: [FMP-FIELD: pictype]<br>Category: [FMP-FIELD: category]<br></td></tr><tr>");

   } 

else 

   { 

   document.write("<td width='156' valign='top'><img src='[FMP-Image:Photo]' border='1'></td>");

   document.write("<td>[FMP-FIELD: picname]<br>Type: [FMP-FIELD: pictype]<br>Category: [FMP-FIELD: category]<br></td>");

   }; 



i++ ;[/FMP-Record] 

</script> 

       </tr> 

<!--          <TD ALIGN=center VALIGN=top colspan="2">&nbsp;</TD>

          <TD WIDTH=156 ALIGN=center VALIGN=top> <div align="left"><a href="[FMP-linkrecid: layout=detail, Format=pdetail.htm]"><img src="[FMP-Image:Photo]" border="1"></a></div></TD>

          <TD width="241" VALIGN=top class=caltext> <p><span class="formtypeplain">Name: 

              [FMP-FIELD: picname]<br>

              Type: [FMP-FIELD: pictype]<br>

              Category: [FMP-FIELD: category]<br>

              Subject : [FMP-FIELD: subject]<br>

              </span><br>

              <a href="[FMP-linkrecid: layout=detail, Format=pdetail.htm]">[bigger 

              Image]</a> </p>

            <p></p></TD>

          <TD width="235" VALIGN=top class=caltext> <p>&nbsp; </p></TD>

        </TR>

        <TR> 

          <TD ALIGN=center VALIGN=top colspan="5">&nbsp;</TD>

        </TR>

        [/FMP-RECORD] -->

      </TABLE>

This works fine. (Needs some more formatting though!)

You can change the variable nCols to vary the number of columns.

All the best.

Garry

This topic is 7935 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.