3 Replies Latest reply: Jun 1, 2009 9:24 PM by DwFAQ RSS

    Go to Detail Page - Display data on the same Master Page

    Crystal_Rouse Community Member

      Hello,

       

      I would like to have a Master Page that I link to a Detail Page and have the Detail items show up on the same page at a bookmark.

       

      Is this possible and are there any suggestions on how to make this happen?

       

      Thanks for any advice/tips out there!

       

      Crystal

        • 1. Re: Go to Detail Page - Display data on the same Master Page
          DwFAQ Community Member

          Heya Crystal,

           

          First you must have a database table setup for master/detail with fields for auto-increment primary key id, title, article, etc. Create recordsets later on as instructed from this database table.

           

          In page.php setup a recordset named master to show master links. Then add a repeat region for the hyperlinks with a url parameter added to the master hyperlinks on page.php as id = to recordset primary key id  so master link repeat region code would look something like this where you want links to appear on page:

           

          <?php do { ?>

          <a href="page.php?id=<?php echo $row_master['id']; ?>"><?php echo $row_master['title']; ?></a><br />

          <?php } while ($row_master = mysql_fetch_assoc($master)); ?>

           

           

          In page.php create another recordset named details filtered by url parameter for id and place binding for details recordset into page.php where you want to detail of the selected article to appear. Your details recordset binding code will look something like this:

           

          <?php echo $row_details['title']; ?><br />

          <?php echo $row_details['article']; ?>

           

           

          Next create a conditional region in page.php so if url parameter id is sent then it will show results from the details recordset and if no id parameter is sent it will show list of master links.

           

          Place repeat region into area of conditional region where you want master links to appear and place binding from details recordset into area of conditional region where you want the details to appear. Conditional region will look something like this:

           

          <?php

          // Show IF id not sent

          if (@$_GET['id'] == "") {

          ?>

           

          repeat region of master links

           

          } else { ?>

                            

          binding from detail recordset


          <?php }

          // endif id is sent

          ?>

           

           

          This will make page.php display all the hyperlinks which go to

          page.php?id=1

          page.php?id=2

          page.php?id=3

          etc.

           

          If you visit page.php with ?id=xxx you will see xxx details on page.php

           

          One file to show master links and the details of the selected link. Hope that helps!

          • 2. Re: Go to Detail Page - Display data on the same Master Page
            beliy333 Community Member

            With all due respect, that was very confusing and hard to follow. Is there tutorial that you know of that explains this process in more detail? I'm a beginner...

             

            Thank you.

            • 3. Re: Go to Detail Page - Display data on the same Master Page
              DwFAQ Community Member

              What step in the instructions are you having trouble with?

               

              You've already been given a link multiple times to a similar, alternative tutorial that explains this process in your duplicate posts regarding the development but sigh here it is again...

               

              http://www.adobe.com/devnet/dreamweaver/articles/develop_web_application.html

               

              Another resource of help is opening Dreamweaver and pressing F1.

               

              I've read your other posts where you claim you have similar dynamic applications already developed like at the end of this thread where you say:

               

              I have the interface for the admin section and the news section already set up.

               

              If you've successfully developed similar dynamic applications by following tutorials like you've claimed then you should really be trying to grasp the concept presented in the tutorials instead of a solution that is placed in your lap since all these developments you're inquiring about (news articles, comments, schedule of events, etc.) all use the same basic principle concepts which are:

               

              1.) create a database table and add fields for data

              2.) create form in DW to insert/edit/delete data to/from database

              3.) create recordsets to display the dynamic data.

               

              It's not rocket science we're talking about here it's like three steps to follow.

               

              If you can't grasp the online tutorials and the concepts they present you may consider hiring a professional to perform your developments or take a course to help you learn.