A reader asked how to make the Cluster Maps demo database work with Instant Web Publishing. A little bit of research in the documentation for Instant Web Publishing (IWP) suggested a possible solution. The Demo database has been updated to reflect these changes.
Inside the FileMaker Pro folder is a folder called ‘Web’
Inside that folder is a PDF called ‘Read Me’. It states:
Use the Web folder to store external files to share with Instant Web Publishing. You can include:
• images and referenced files for container fields
• static HTML pages
• a customized Database Homepage with the filename iwp_home.html
For more information, see the FileMaker Instant Web Publishing Guide.
Modify $Path variable step in the ‘Generate JSON..’ script.
Modify the Case statement to include another menu option
Add a case statement for saving to the Web path:
Settings::gSave_File_Location=”FileMaker Web”; Get ( FileMakerPath )&”/Web/”
Add ‘FileMaker Web’ as an option to the Export Value list.
Change the ‘File Locations’ Value List
Add ‘FileMaker Web’ to the list
In the database Settings tab, change the ‘Save File Location’ field to ‘FileMaker Web’
Cluster Map generated to the FileMaker Pro Folder: Web folder
Viewing the Cluster Map in a browser
Once it is generated, the file is available to view at this IP address: Localhost/MyClusterMap.htm
A calculated version of this URL is Get ( HostIPAddress )&”/”&Settings::gFile_Name
Modify the Display Map script
Add Checks for IWP and FileMaker Web file saving
To making viewing the file in IWP simpler, modify the ‘Display Map’ script to include a couple of checks upfront.
Check if the ‘Save File Location’ is set to ‘FileMaker Web’ and the database IS being viewed from IWP
If [ PatternCount ( Get ( ApplicationVersion ) ; “Web” ) >0 and Settings::gSave_File_Location=”FileMaker Web” ]
Open URL [ Get ( HostIPAddress )&”/”&Settings::gFile_Name ]
Halt Script End If
Check if the ‘Save File Location’ is set to ‘FileMaker Web and the database is NOT being viewed from IWP
If [ PatternCount ( Get ( ApplicationVersion ) ; “Web” ) =0 and Settings::gSave_File_Location=”FileMaker Web” ]
Open URL [ Get ( SystemIPAddress )& “/”&Settings::gFile_Name ]
[ No dialog ]
Halt Script End If
Set up Instant Web Publishing
1) Turn Instant Web Publishing on,
2) select your database and
3) set the appropriate privilege set.
Cluster Maps viewed from IWP
1) Generate the HTML file
2) Click ‘Display Map’
Cluster Map viewed from a Web Browser using IWP
Finally, I modified the Generate JSON and HTML script to eliminate the IWP unfriendly dialog box and Display Map steps. Now it is a two step operation to view the maps. 1) Generate and then 2) Display.
Cluster Maps – Update – Fixed Popup Formatting Bug