8 Replies Latest reply on Nov 24, 2010 10:45 AM by philmodjunk

    managing multiple images in one record

    cliffacconci

      Title

      managing multiple images in one record

      Post

      Hello,

      I am creating a database which keeps track of architecture projects.  Each record has one architecture project which should have multiple images of the architectural process (an image of a drawing, a photo of a model, a photo of the building, etc.)  When the record is choosen, I would like to view one image at a time and create a previous and next button to cycle through these images. 

      From reading previous forums, it seems I have to create what is called a 'portal' between two tables,my architecture projects and an 'image storage' table.  I don't really understand how portals work but I have created a 'image storage' table with one container field which holds 5 repetitions(one repetition for each image of a project.)  This is where I don't know what to do. 

      Do I create an image container field with the same name in my architecture inventory table?  And if I do this, when I try to create a relationship, container fields are greyed-out and do I make the relationship the "=" sign?Once this relationship is created properly, If a user creates a new record in the architecture inventory, can they just drag and drop new images into empty repetitions slots on the image field displayed in the portal?

      Also, once I establish this portal and get it to work, is it possible to create  two buttons to cycle through the 5 images held in this repetition? like a previous and next button.

      help, confused!

        • 1. Re: managing multiple images in one record
          philmodjunk

          Better start over with your design here. Wink

          In your image table define at least three fields--none of them should be repeating fields.

          ImageID (auto entered serial number)
          Image ( Container )
          ProjectID (Number )

          You should use Manage | Database | Relationships to link your two tables:

          Projects::ProjectID = ImageTable::ProjectID

          Now you can add a portal to your image table to display images, change them, delete them or add new ones. (If you want to use a portal to add new records, you have to enable "allow creation of records via this relationship" in Manage | Database | relationships.)

          Portals are well documented in FileMaker help, so you should look the term up as it is very frequently used layout element in FileMaker Pro databases.

          Portals aren't the only way to do what you describe here, but it's probably the easiest to set up.

          1 of 1 people found this helpful
          • 2. Re: managing multiple images in one record
            cliffacconci

            Hi Phil,

            Thanks for this info. I've created what you said and it worked. Some follow up questions from the first request.

            How do I store multiple images in one of the imagetable records? 

            Once I can contain these multiple images, How do I create buttons which can show 'previous' and 'next' images in the portal display in the architecture projects. 

            Thanks so much for your help and clarity

            Cliff

            • 3. Re: managing multiple images in one record
              philmodjunk

              "How do I store multiple images in one of the imagetable records?"

              Why would you want to do that? With your portal, you can just keep adding more images to new portal records and still see them all for a given project.

              "How do I create buttons which can show 'previous' and 'next' images in the portal display in the architecture projects."

              Before we try the button approach, there's a simpler way to do this that may be much easier for a beginner to implement.

              You can enable a scroll bar for your portal. To see different images, you can just scroll the portal. You can put a button in the portal row or just set up the container field as a button that when clicked takes the user to a layout where the container is enlarged to fill the entire layout if you need to see the image enlarged. A button on this new layout would take you back to your original layout.

              Would that work for you?

              • 4. Re: managing multiple images in one record
                andrewggrant

                Phil,

                The portal will automatically add records to the imagetable if you have setup the option to enable "allow creation of records via this relationship" in Manage | Database | relationships.

                When you add multiple entries to a portal, you should be able to scroll through the images if you added the option to add a scroll bar in the portal settings.

                As for buttons, I set the Container field in the portal to be a button that was set to "Go to related records" and opened them in a new window. This new window had a button to print, export, and a field to update the description. Since I showed all the related record for the currently selected record, I was able to use the record navigation buttons at the top of the window to move between each picture.

                It is a very simple approach, and may not be the refined answer you are looking for, but I hope it helps to get you on the right path.

                • 5. Re: managing multiple images in one record
                  cliffacconci

                  Thanks for this clarity, I will deal with the vertical scroll bar instead of "previous" and "next" buttons as it seems like it would need a real overhaul to do this.  Thanks, these solutions worked perfectly.

                  2 Follow up questions.

                  1. Is it possible to double click on the portal'd image and have it enlarged, possibly in the windows viewer?

                  2. I am trying to store image files in filemaker pro just as references and provide a button or link to images stored on my harddrive...Right now I have a button "Insert picture" which inserts pictures into the portal row that is selected.  I've tried looking for forum answers and the closest I can find is get(filepath) but I don't know how to get it from inserting the picture into a separate field to store it.  I imagine I'd need to send this filepath to another text field and then have another button that work do a openurl of this filepath.

                  help! 

                  thanks

                  cliff

                  • 6. Re: managing multiple images in one record
                    philmodjunk

                    1. Is it possible to double click on the portal'd image and have it enlarged, possibly in the windows viewer?

                    Since you are using the "store by reference" option, you will need a script to export the field contents in order to open it in your system's image viewer. If you don't use store by reference, double clicking the container field holding an image will do that automatically.

                    With a script, you can set up your container field as a button and then clicking it can run a script that exports the field to a temporary items folder and opens it for viewing. You can also such switch the user to a different layout when they click the image and you can put an enlarged field on this layout to get a very similar effect.

                    I am trying to store image files in filemaker pro just as references and provide a button or link to images stored on my harddrive...Right now I have a button "Insert picture" which inserts pictures into the portal row that is selected.  I've tried looking for forum answers and the closest I can find is get(filepath) but I don't know how to get it from inserting the picture into a separate field to store it.

                    I'm not sure I fully follow that. Images stored by reference store a file path to the image in the container instead of the image. FileMaker uses that file path to access the file and display the image in the container. If you have multiple users accessing the file over a network. You have to first store the images in a shared directory that all your users can mount in identical fashion, then insert the image by reference from this shared directory.

                    If you want to use FileMaker to move the file from your local machine to a server's shared directory, you can insert the file first without the store by reference option, then use Export Field contents to export it to the shared directory. Then FileMaker can re-insert the file by reference from the shared directory. That takes a fairly sophisticated script, but it can be done.

                    • 7. Re: managing multiple images in one record
                      cliffacconci

                      Hi,

                      For question 1., setting up the containerfield in the portal to export the field to a temporary items folders and opens for viewing sounds what I'm trying to do.  I don't know what a temporary items folder is but I can try this if you know what scripts I would need to do all this.

                      In terms of question 2., I would like to take the file path associated with the inserted image(stored as reference) and be able to open this file path in a  folder viewing window with my windows operating system.  The purpose of this would be to have users have quicker access to where the actual full size image files are located by performing record searches on filemaker pro.  it wouldnt need to open the file, just open the folder that holds it.  does that make more sense?

                      thanks

                      Cliff

                      • 8. Re: managing multiple images in one record
                        philmodjunk

                        Here's a script I got from another member of this forum:

                        Set Variable [ $filepath ; Value:  Case ( Abs ( Get ( SystemPlatform )) = 1; "filemac:"; "filewin:" ) & Get ( TemporaryPath ) & "fm_file.jpg" ]
                        Export Field Contents [ YourTable::YourContainerField ; $filepath ; Automatically Open ]

                        Opening a folder is a bit more problematic. You may need to acquire a plug in that gives you more options. The Moo plug for windows systems  is one I know of that happens to be a free download. Other plugins from other developers are also available.