2 Replies Latest reply on Dec 17, 2008 6:48 AM by (John_Groh)

    Content Management Tutorial Question

      Hi all,

      I have been using the content management tutorial to build a site and I have a really simple (I think) question...I created the index.php page and included the "home.php" as the very first default page that comes up using the SB Server Side Includes from List. On the home.php page I created a filtered recordset to retrieve the body of the pages from the database.

      I also created the menu (according to the instructions on the tutorial)that passes the id_pag parameters correctly to the index page. But, my question is...by doing it this way, the homepage info does not come up by default because no parameter has been passed. So in the SB Includes from List, the first page listed is home.php and no URL parameter value assigned to make it come up by default.

      Is there a way to have it so that when the site is brought up in a browser, the parameter id_pag=1 is attached to the home.php page and the info is visible?

      John
        • 1. Re: Content Management Tutorial Question
          Günter Schenk Level 4
          Hi John, <br /> <br />------ <br />Is there a way to have it so that when the site is brought up in a browser, the parameter id_pag=1 is attached to the home.php page and the info is visible? <br />------ <br /> <br />this is technically not possible -- better consider providing a default content in case the variable "id_pag" isn´t set, and use ADDT´s Show IF conditional region to create an if-else condition, example: <br /> <br /><?php<br />// Show IF Conditional region_show_contents<br />if (!isset($_GET['id_pag'])) {<br />?> <br />default contents here <br /><?php<br />// else Conditional region_show_contents<br />} else { ?> <br />display Includes from List contents here <br /><?php }<br />// endif Conditional region_show_contents<br />?> <br /> <br />Cheers, <br />Günter Schenk <br />Adobe Community Expert, Dreamweaver
          • 2. Re: Content Management Tutorial Question
            Level 1
            Thank you for your help Gunter! That worked great.

            Just to expand on what I did in case anyone else needs help...I took Gunter's code above (just remember to delete the "}" in the last
            One, named rsHomepage, was filtered to id_pag = Entered Value 1 (to just grab the homepage content) and the other, named rsPage, filtered id_pag = URL Parameter id_pag (to get any of the other pages).

            Then I just replaced some parts of Gunter's code with bindings from my recordsets and viola! It worked. Here is my code married with Gunter's: