• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 922
  • Last Modified:

DreamWeaver design view propblem with PHP code

I've been encountering this problem on DW 8, DW 2004MX and DW CS3. Everytime I import some PHP code into my HTML code using DW in the design view site becomes scattered. From WYSIWYG becomes "take a guess what you'll see". Have no choice but work blindfolded. In web browser preview the site is perfectly layed out. Its quite painful everytime preview changes in browser. Anyone can advise on this?
0
kbit
Asked:
kbit
  • 5
  • 5
  • 4
2 Solutions
 
BlargerCommented:
In Dreamweaver's help index, look up 'Testing Server'. There you can learn how to set up Dreamweaver to process dynamic pages(including php) on a testing server.
0
 
Jason C. LevineNo oneCommented:
Hi kbit,

You can't import PHP code into design view if you are selecting source code and trying to paste it into design view.  DW will do its "paste code as text" operation and screw things up.

However, if the original code shows up as selectable PHP tags (the small gold icon) in design view, that CAN be copy/pasted from within DW.

I'm a little unsure as to what you are trying to do here...
0
 
kbitAuthor Commented:
sorry, I'll try to explain it properly...
Lets say I design a basic layout of the sign using CSS in DW. Everything looks great in design view. As soon as I insert some PHP code in the code view obviously and when I switch it back to design view layout becomes just mad. I hope this is clearer.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Jason C. LevineNo oneCommented:
Yes, a bit better.  

Check Edit | Preferences | Invisible Elements and see if the Visual Server Markup Tags and Nonvisual Server Markup Tags options are checked.  If so, uncheck them and see how that changes your design view display.

A lot of this depends on what exactly you are inserting as PHP.  If it is an if statement that echos different HTML based on the evaluation of the if, then you will see some sort of effect in design view.  At this point, you should follow Blarger's advice and use the preview mode and the testing server to get a better sense of what is happening.  

If it still looks wrong, post the source code and maybe we can find another workaround for it.

0
 
BlargerCommented:
You can set Dreamweaver to execute a file on a testing server. You can also disable dynamic code by going to Edit->Preferences->Invisible Elements and then uncheck Visual Server Markup Tags.
0
 
kbitAuthor Commented:
thank you guys for help :)

Check Edit | Preferences | Invisible Elements and see if the Visual Server Markup Tags and Nonvisual Server Markup Tags options are checked.  If so, uncheck them and see how that changes your design view display.  HAVE DONE THAT NO CHANGES IN DESIGN VIEW, STILL SCATTERED AS IT WAS BEFORE.

Design view hasn't changed. I had the testing server set up and have no problems with the layout in the browser preview. When I design layout of a website always trying leave PHP till last for as long as I can so I can place and move around objects on a page and be able to see it properly in the design view wihtout having preview page in the browser.

From your replies I'm getting impression that there is no way around it or is there...?
0
 
BlargerCommented:
With all of the differences between browsers, I would suggest not using Dream Weavers design view feature. I make a static template test page displaying all of the CSS classes, styles and formats of the web site I am creating, and then test it in each browser for compatibility issues. After I get everything to look the way I want, I can then work on the actual site and use the code from the template test page. That's what works best for me.
0
 
Jason C. LevineNo oneCommented:
>> From your replies I'm getting impression that there is no way around it or is there...?

Can you post a screenshot of DW in Design View after a paste?  I've seen little stuff change after adding code, but you seem to imply that this is a major change in design view and I'd like to see it for myself.
0
 
kbitAuthor Commented:
It will sound silly but how can I post a screenshot to you? :)
0
 
BlargerCommented:
Pressing the 'Print Screen' button will take a screenshot of your desktop and put it into your clipboard. You can then paste it into any image editing software that you have and then save it. Then upload it to your web host or a free image host and the post a link to it.
0
 
kbitAuthor Commented:
very funny :)))

I thought there is a way to upload an image to with a comment.
0
 
kbitAuthor Commented:
this the link to the screenshot:

http://www.pform.co.nz/images/DW-screenshot.jpg

and this is how it should look like:

http://www.pform.co.nz/
0
 
BlargerCommented:
The design view displaying '</div></div>' is a little odd.

Try validating your page at w3.org and see if there are any errors.
http://validator.w3.org/#validate_by_uri
0
 
Jason C. LevineNo oneCommented:
>> The design view displaying '</div></div>' is a little odd.

Yes.

kbit, please post the source code with the offending PHP in place.  I think you may have a small syntax problem in your PHP...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now