Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

formatting results, more than one result per row

Featured Replies

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 !

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...

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

  • Author

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 ?

  • Author

Here are my files.

photo.zip

I'm travelling for the next few days, so I will be able to check it out on the weekend.

All the best.

Garry

  • Author

Thanks ! laugh.gif

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

  • Author

It works great. You are my hero. laugh.gif

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.