2 Replies Latest reply on Jul 30, 2010 9:40 PM by GarethForwood

    Creating a Database Homepage

    GarethForwood

      Title

      Creating a Database Homepage

      Post

      Hi all,

      I want to create a homepage for my photo database, that provides an easy location from which to access the most useful forms and search functions.  I have created scripts to link to these pages and change the view mode where necessary.  Aside from the links, I also want to show 5 random photos from my entire collection, and 5 random photos from those with a high rating (i.e. the field "rating" = 5).  I also want to show some key database statistics on the homepage (e.g. No. Photos, No. unique values for particular fields, 5 most common values of particular fields etc).  Finally, I would like to have a search function on the homepage, where I can search for values in particular fields but also a "keyword" search that searches all the fields.

      My questions are:

      1. Would this layout best be achieved in the Browse mode?  If not, which mode would be best?
      2. How do I go about returning the random records?
      3. Is a search feature possible in Browse mode (assuming that this is the best mode for the layout)?

      Many thanks to all who can answer, I have learned so much in such little time thanks to you all!

      Gareth

        • 1. Re: Creating a Database Homepage
          philmodjunk
          1. Would this layout best be achieved in the Browse mode?  If not, which mode would be best?

            Yes, use browse mode
          2. How do I go about returning the random records?

            One method is to use Replace Field contents and the random function to assign a random number to a field in the table. You could then display your records in a portal is set to sort the records by this random number field and only shows the first 5 such records
          3. Is a search feature possible in Browse mode (assuming that this is the best mode for the layout)?

            This is frequently done. You define global fields for the user to enter search criteria, then add a button that runs a script to enter find mode and uses the data in the global fields to build one or more find request to find your records.

           

          I use a more elaborate version of what you describe in my Known Bugs List database: http://www.4shared.com/file/8orL8apk/FMP_Bugs.html

          It uses global fields and includes a "Keyword" search that finds records containing those words in either the Title or Description fields. Feel free to examine all the scripts and use ideas that you like. There is a custom function that parses a value list of keywords from these same two fields, filtering out numbers and words of two letters or less, but you need not use that custom function to do what you want here nor do you have to use the popup search window--you can just start with global fields on your "home" page.

           

          • 2. Re: Creating a Database Homepage
            GarethForwood

            Hi Phil,

            Sorry it took me a while to get back to you.  Many thanks for your help, your methods worked perfectly!  Another successful visit to the forums!

            Kind regards,

            Gareth