Jump to content

Making a web page from images


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

Recommended Posts

I am hoping to take a found set of images in container fields and generate the guts of a simple web page in a calculation field using repeating segments of code like the one below. I already have the filename isolated in a calculation field, and have posted another question in this forum about isolating the pixel dimensions too (though dimensions are not essential). The repeating code segment looks like this:

filename

filename

Contents of a description text field

The above should be relatively simple to generate with a calculation, but the difficulty for me is how to get it to loop through a found set and add each repetition into the one text field or text file so I can copy and paste it into an html template file. In other words, how to wind up with the following all in the one place:

pineapple.jpg

pineapple.jpg

A pineapple growing in a Fiji plantation

guava.jpg

guava.jpg

Guava fruit, rich in vitamin C

....etc....

Any help hugely appreciated.

Link to comment
Share on other sites

No responses so far, so maybe Filemaker is unable to concatenate data from several records into the one place. I'm surprised.

Maybe I can do it by sending a system event to a Windows command-line utility that will concatenate or splice text from a looping Filemaker script into a text file. It's got to be possible.

Link to comment
Share on other sites

It's actually quite simple. You need a global text field to concatenate the result. The script would be something like this:

Go to Layout [ "YourLayout" (YourTable) ]

Show All Records

Sort Records [ Restore; No dialog ]

Go to Record/Request/Page [ First ]

#

Set Field [ Globals::gExport; <<< your preamble calc >>> ]

#

Loop

Set Field [ Globals::gExport; Globals::gExport & <<< your repeating calc >>> & ¶ ]

Go to Record/Request/Page [ Next; Exit after last ]

End Loop

#

Set Field [ Globals::gExport; Globals::gExport & <<< your postamble calc >>> ]

#

# Export Field Contents [ Globals::gExport; "file:../somefile.html" ]

#

Go to Layout [ original layout ]

---

Another option is to use XML export, with XML-to-HTML stylesheet. It's a bit more complex - see the XML example file in the documentation.

Link to comment
Share on other sites

Wow, fantastic. Thanks heaps for this -- it's going to save me hours of laborious work. I can't believe it's so easy. I'm working on implementing it now, and it looks good so far.

For the sake of anyone else reading in future, I've had to create a global field containing a double quote to get the formulas to work correctly with all the quotes required for html. So, one of my calc lines looks like this:

"& Globals::gQuote & Filename & Globals::gQuote & ¶ &</p></div></body></html>

Link to comment
Share on other sites

This topic is 6536 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.