7 Replies Latest reply on Jun 2, 2011 2:29 PM by Nancy OShea

    Design View Not Working Properly

    jarodsafehouse71 Level 1

      Hi, I save my web site files as .php and I'm using DW CS5. When I switch to Design View all I get are a couple of icons. Why won't it display the page for me?

        • 1. Re: Design View Not Working Properly
          Ben M Adobe Community Professional

          jarodsafehouse71 wrote:

           

          Hi, I save my web site files as .php and I'm using DW CS5. When I switch to Design View all I get are a couple of icons. Why won't it display the page for me?

           

          Design View does not render PHP code.  You need to activate Live View for that.

          • 2. Re: Design View Not Working Properly
            bemdesign Level 4

            PHP is a server side scripting language - it requires a server to parse the script and render the output. Dreamweaver can not, by itself, parse PHP - it needs a testing server to do the PHP parsing and render the resulting output, for it.

             

            And Design view is...spotty...at best. It's really just a rough guestimate by Dreamwever on how static HTML (not PHP) would look like, possibly, in a browser. If you want accuracy, use Live View.

             

            And again, for PHP, set up a testing server.

            • 3. Re: Design View Not Working Properly
              jarodsafehouse71 Level 1

              But it's regular html, not php code. Is it because of the .php extension then?

              • 4. Re: Design View Not Working Properly
                Ben M Adobe Community Professional

                jarodsafehouse71 wrote:

                 

                But it's regular html, not php code. Is it because of the .php extension then?

                 

                Anything that is between <?php and ?> requires the server to process the code regardless of what code you put in between there.  You can use PHP code on a page that begins with the HTML doctype declaration vs a PHP statement if you want HTML to load.  For instance:

                 

                <HTML>

                ...

                <body>

                [lots and lots of stuff here]

                <?php [some php stuff here] ?>

                [lots more stuff here]

                </html>

                 

                In that example the "lots of stuff" will load and an icon will show for the "php stuff".  Given that is not valid code just a representation, but it should hopefully get the point across.

                • 5. Re: Design View Not Working Properly
                  bemdesign Level 4

                  The .php extension tells Dreamwever that it's supposed to be a PHP file and it needs to be processed by the server first before rendering, even if the php file doesn't contain a single bit of PHP code.

                   

                  So if you want to write static HTML pages and have Dreamqweaver's Design view give you a rough approximation of what you're doing, use the HTML filetype (.html or .htm) and not PHP.

                   

                  Now if you really are going to use PHP, set-up a testing server that can parse your PHP.

                  • 6. Re: Design View Not Working Properly
                    timmer101

                    I am having the same problem with design view.  Even when I open a new page.  I have removed all file extensions from the open in code view in preferences but still design view does not work.  Can you help me?

                    • 7. Re: Design View Not Working Properly
                      Nancy OShea Adobe Community Professional & MVP

                      Save file as 'test.html'

                      If you still cannot see anything in design view, use the validation tools below and fix reported errors.

                       

                      Code Validation Tools
                      ------------------------------------
                      CSS - http://jigsaw.w3.org/css-validator/
                      HTML - http://validator.w3.org/

                       

                      If you're still not seeing anything in Design View, post your code into the web forum with  >> Syntax highlighting > Plain.

                       

                       

                      Code in the web forum looks like this.
                      

                       

                       

                       

                      Nancy O.
                      Alt-Web Design & Publishing
                      Web | Graphics | Print | Media  Specialists 
                      http://alt-web.com/
                      http://twitter.com/altweb