1 2 Previous Next 24 Replies Latest reply on Mar 8, 2012 3:52 PM by beverly

    Exporting html

    dcwells

      I've been working on a project to create streaming media files with synched slides. I now have the database working properly and only have to export out the html. How can I create an html file inserting in data from the database? In the past, I had used Access and was able to do this. I would have one table with all the html tags then create a query that would put the tags around the database items and export the file. Is this possible with filemaker?

        • 1. Re: Exporting html
          comment

          Have a look at the 'xml example.fp7' file that comes with the application.

          • 2. Re: Exporting html
            beverly

            dcwells, Michael is referring to the ability to export xml from FileMaker and apply an XSLT to transform the xml into HTML. XSLT uses the 'xsl:output' to specify the method="html".

             

            If you don't need a complex HTML export, you can just add the HTML tags in a calculation, like this:

            ""
            (this is a "row calculation" with those fields in that row/record.)

            Add the other tags as needed to the start and end of the export. If you export the one calculated field as "tab-delimited", it will give you one "...

            " & field1 & "

            " & field2 & "

            " per record.

             

            Remember to save the export with the .htm extension.

             

            If you need to be more complex, the XSLT or calculation method can be used to create the HTML.

            Beverly

            • 3. Re: Exporting html
              Malcolm

              On 24/02/2012, at 11:40 AM, Beverly Voth:

               

              dcwells,

               

              Michael is referring to the ability to export xml from FileMaker and apply an XSLT to transform the xml into HTML. XSLT uses the 'xsl:output' to specify the method="html".

               

               

              If you don't need a complex HTML export, you can just add the HTML tags in a calculation,

               

              It is also possible to Export and specify HTML. This produces a table.

               

              Malcolm

              • 4. Re: Exporting html
                lkeyes

                Hi Beverly....  

                 

                you said,  "If you don't need complex html...."  what if I do?  

                 

                I'd like to be able to generate catalog pages,  one html file per item, that include CSS, and tables.

                 

                I looked at  Export and specifying HTML, that works fine, as far as it goes, but basically creates just a raw table, with no colors or control over the appearance. 

                I also want to put in page titles and footers,  and then generate a listing page which has links to the other pages.

                 

                Is there a "standard" approach that people use to do this sort of thing? 

                 

                TIA

                 

                ---- Larry

                • 5. Re: Exporting html
                  beverly

                  "Complex" is images and javascript and page specific CSS.

                   

                  If you have pages that could use a "template" (one per record, for example), then its not really so complex. You probably have one css used by all pages.  Then you can use XML/XSLT or calculations to export the pages.

                   

                  If there are common elements, such as header and menu and header, these could be pushed into global fields and/or variables for use on each page. Just call them in your calcs.

                   

                  If you have multiple records (becoming a table), you push the header before the first record and the footer after the last record.

                   

                  I'll look for examples that I can post using these methods.

                   

                  -- sent from my iPhone4 --

                  Beverly Voth

                  --

                  • 6. Re: Exporting html
                    Malcolm

                    On 27/02/2012, at 12:09 PM, lkeyes said:

                     

                    you said,  "If you don't need complex html...."  what if I do? 

                     

                    I'd like to be able to generate catalog pages,  one html file per item, that include CSS, and tables.

                     

                    I looked at  Export and specifying HTML, that works fine, as far as it goes, but basically creates just a raw table, with no colors or control over the appearance.

                     

                    I also want to put in page titles and footers,  and then generate a listing page which has links to the other pages.

                     

                    Is there a "standard" approach that people use to do this sort of thing?

                     

                    A while back I was asked to make a simple framework to manage a small web site and I used the technique set out below.

                     

                    1. Export fmp data and upload as one file.

                    2. Have a template that was something like this:




                    <?php

                    1. pull in content here;

                    ?>

                    <!-- footer -->

                    </body>

                    </html>

                     

                    3. Have all navigation pass a number via the URL.

                    4. Where it says "pull in content". I would check to see what number is in the URL then go to the data file, read down to line X, and print that line.

                    5. You can extend this as much as you like and you can go a very long way with a few lines of code.

                     

                     

                    Nowadays I wouldn't bother with that at all because there is a much easier way:

                     

                    1. Create a blog using whatever blogging platform you prefer.

                    2. Create FMP database with a web viewer.

                    3. Add a field in FMP to store the web blog urls and page IDs

                    4. Have a couple of scripts that send URLs to the web log. One to create a new record in your blog. One to show current record in the blog.

                    5. Cut and paste between FMP and the blog.

                     

                     

                     

                    Malcolm

                    • 7. Re: Exporting html
                      beverly

                      I really HATE the way this forum munges code snippets! Here's the post as image:

                      export_html_post.jpg

                      • 8. Re: Exporting html
                        dcwells

                        Hi Beverly,

                         

                        Thanks for the help on this.  I am trying to do the export as a calculation.  I have a list of slide names, times and locations.  How can I write a calculation that will select all the items in a found set?

                         

                        thanks,

                        • 9. Re: Exporting html
                          sporobolus

                          on 2/27/12 6:31 AMBeverly Voth wrote

                           

                          I really HATE the way this forum munges code snippets!

                           

                           

                          me too! but note that there is markup to work around the problem when emailing

                          the forum; it consists of this "tag" (represented symbolically since  i cannot

                          literally use it in this email):

                           

                             open-curly-bracket the-word-"code" close-curly-bracket

                           

                          used both before and after your code segment; its major failing (aside from

                          malign obscurity) is that it doesn't understand how to handle linebreaks in

                          format=flowed context

                           

                          here i'll try it with your code:

                           

                          "<tr><td>" & field1 & "</td><td>" & field2 & "</td></tr>"
                          

                           

                          • 10. Re: Exporting html
                            beverly

                            dc, it would depend upon how you have your tables related (if at all). How are you "list of slide names, times and locations" represented in your database?

                             

                            So, if you have a table of "projects" and have related "slides", you 'd go to each Project, create the html, go to the related slides, append the html, go back to projects and export the HTML. This method would use variable(s) to "gather" the calculated HTML. I like to push to a single global field and use the Export Field Contents script step.

                             

                            Do you have the NAME of each exported file as a field in the database? This allows you to name each file in a way that you control. Otherwise you have to come up with a caclculated name and/or number, so that each record exported is a unique page.

                             

                            I have some old examples of exporting HTML, I'll see what I can post.

                            • 11. Re: Exporting html
                              dcwells

                              Hi Beverly,

                               

                              After looking into some of the xslt info, I wonder if I would be better off using that.  I have used xsl before, but I had exported the database as xml, then had different xsl pages that would display the data.  I tried doing something similar, but ran into issues.  My project is fairly simple.  I have three tables, project, presentation and slide timings.  The user would start by creating an new project - think of a project as everything that would happen in one room of a seminar - it would have multiple presentations happening, but only one set of slides and slide times.  When you create a project, a project ID is stored and added to any slide or presentation that is added.  The user can then add numerous presentations to the project.  The presentations, project and slides are related by the project ID.  I would like to export out the data as an html file that would have:

                               

                              presentations:Title

                              presentations:Description

                              presentations:StartTime

                              presentations:EndTime

                               

                              all slides that have slides:ProjectID=presentations:ProjectID and slides:slide time greater than presentations:StartTime and slides:slide time less that presentations:EndTime

                              so I would have a list of 

                               

                              slides:slide name

                              slides:slide title

                              slides:slide time

                               

                              slides:slide name

                              slides:slide title

                              slides:slide time

                               

                              slides:slide name

                              slides:slide title

                              slides:slide time

                               

                              I have a feeling this is not hard to do, I am just perplexed on how to make it work in Filemaker Pro.  As always, thanks for your help.

                              • 12. Re: Exporting html
                                lkeyes

                                Wonder if anyone (Beverly?) could point us to some code examples ...  

                                 

                                I think I've managed to work out my problem using PDF exports, but it is a bit rough.   still not sure how to do html....  

                                 

                                --- L

                                • 13. Re: Exporting html
                                  comment

                                  dcwells wrote:

                                   

                                  I would like to export out the data as an html file that would have:

                                   

                                  presentations:Title

                                  presentations:Description

                                  presentations:StartTime

                                  presentations:EndTime

                                   

                                  all slides that have slides:ProjectID=presentations:ProjectID and slides:slide time greater than presentations:StartTime and slides:slide time less that presentations:EndTime

                                  so I would have a list of

                                   

                                  slides:slide name

                                  slides:slide title

                                  slides:slide time

                                   

                                  slides:slide name

                                  slides:slide title

                                  slides:slide time

                                   

                                  slides:slide name

                                  slides:slide title

                                  slides:slide time

                                   

                                  I have a feeling this is not hard to do

                                   

                                  I don't think it's hard to do. However, it's not quite clear what you mean by "a list" when you speak of a HTML file.

                                  • 14. Re: Exporting html
                                    dcwells

                                    The final html would have a list with every slide name, slide title ect. displayed as such:

                                     

                                      <ul>

                                     

                                     

                                              <li><a href="#SlideName01">SlideTitle01</a></li>

                                     

                                     

                                              <li><a href="#SlideName02">Slide</a></li>

                                     

                                     

                                                </ul>

                                     

                                     

                                    The timings would go into a SMIL file - if I can figure this part out, I can figure out how to write that part.

                                     

                                    thanks,

                                    1 2 Previous Next