6 Replies Latest reply: Jan 9, 2013 11:19 AM by Jon Fritz II RSS

    How to create content that my client can update himself

    DiNoia

      Hello!

       

      I'm fairly new to Dreamweaver and new to this forum so I would greatly appreciate help from the experts.

       

      I am about to start building my second website and my client wants to be able to have content (probably only type in a "News" section) that he can update himself as often as he needs to without contacting me every few weeks. What is the easiest way to set this up? I looked into creating a Wordpress site within Dreamweaver, but that seems like an awful lot just to accomplish this.

       

      Thank you!

        • 1. Re: How to create content that my client can update himself
          Jon Fritz II MVP

          If he is using an html editor, doing a simple .php include is pretty easy.

           

          As long as you have .php on your server (most hosts do), it's as simple as adding in a little line of code, for example:

           

          <?php include("content.php"); ?>

           

          Wherever you want your content.php file to show in your main page.

           

          In this situation, you would have your news page set up with a .php extension (just change .html to .php) and within that page you would have the include code that points to the content.php page in the location where you want that content to load. Your client would then only update and upload the content.php page which would only have the html for the text and images that they want to add. The content.php page would not have the html, head (or its contents) or body tags, since those will already be written into your news.php page and you wouldn't want to duplicate them, so literally just the html for the text and images in the content.php file.

          • 2. Re: How to create content that my client can update himself
            DiNoia Community Member

            Thank you  for your response Jon. Let me take it step by step to make sure that I understand.

             

            1. Name my News page news.php instead of news.html
            2. Build the page
            3. In area where I want the changeable content, I include this line of code: <?php include("content.php"); ?>
            4. Create a content.php page that contains only the content that is to be changing weekly.

             

            Is this correct?

             

            The changeable section will only contain <h2> and <p> tags with the ability to style in bold & italic. My client has no web experience whatsoever, so I want to make it as simple as possible for him. Will this be a simple process for him?

             

            Much appreciated!

             

            -Mark

            • 3. Re: How to create content that my client can update himself
              Jon Fritz II MVP

              Yep, that'll do the trick, just make sure the content.php file is saved in the same directory as the news.php page if you leave the link the same in the .php include snippet.

               

              It may take a little effort on your part to help them understand what they're doing initially, but it's always gone smoothly for me in the past with clients who wanted to do updates.

              • 4. Re: How to create content that my client can update himself
                DiNoia Community Member

                I just tested it on my desktop and it all works. Thank you for your help!

                • 5. Re: How to create content that my client can update himself
                  DiNoia Community Member

                  Oops, I may have spoken too soon. It worked in Live view in DW, but when I go to preview in a browser it doesn't work. In Firefox, it just keeps opening blank windows until I quit and in Chrome, Opera & Safari it just shows a few pixels of the background color. Will this only preview properly when it is uploaded to a server, or can I get it to work locally?

                   

                  Thanks Jon!

                  • 6. Re: How to create content that my client can update himself
                    Jon Fritz II MVP

                    That's normal.

                     

                    DW will mimic the server  by processing php includes internally to some extent. Preview in Browser won't work at all.

                     

                    If your server has .php, uploading and viewing the files will work fine.

                     

                    You could set up a local server to verify everything is correct before uploading to your webserver by installing XAMPP (PC) or MAMP (Mac)  which will allow you to run Apache web server, php and mySQL locally for testing.