Web Hosting Talk







View Full Version : Applying CSS while editing in Dreamweaver tips?


Mechphisto
12-09-2008, 01:15 PM
Applying CSS while editing in Dreamweaver tips?

I have an annoying issue in Dreamweaver CS3 that I was hoping I could get some help on.
I have a site I'm working on. The file structure is:
W:/site/
-- contains page.php which is the bare frame for all the pages. The styles.css link and all head info, etc. is in this page.
W:/site/includes/
-- contains styles.css which has all the styles
W:/site/data/
-- contains all the actual data pages that get included into page.php via PHP (that it's PHP is not important)
Now, when I'm working on, say, W:/site/data/123.php, the DW GUI has no idea what styles are available as all 123.php is is text with DIV id's and SPAN classes attributed. On the Web site, the contents of this page would simply get included into page.php.
So the DW preview shows everything in default appearance.
If I link the styles.css into the file, sure I edit it and it'll let me use the styles in the GUI instead of my having to keep looking at the styles page and hand-typing in ...class="blah"....
But the link will be put in as "../includes/styles.css" which works while I'm in DW, but doesn't while it's on the Web as...you get it, because 123.php doesn't technically exist when it's rendered to the browser...it's embeded in page.php so "../" becomes meaningless.
Does this make sense?
Bottom line: Is there some DW tip that will allow me to either make it recognize PHP includes so it logically knows where everything will be when it's rendered by the browser, or, universally apply a CSS page to everything I'm working on without having to worry about link paths that work fine locally but foobar on the remote?
Thanks for any suggestions.
-Liam
<<snipped>>
Thanks.





Last edited by bear : 12-09-2008 at 01:58 PM.

jasper_
12-09-2008, 01:33 PM
it does. which version of DW you have? Enable live edit and it should see your included CSS.





__________________
J. August
Web

Mechphisto
12-09-2008, 01:38 PM
CS3. (Specifically, Version 9 Build 3481).
Live edit? That sounds suspiciously like editing the files directly on the remote server. If so, me no likee. Too risky in my experience. I like to edit and design and change, and then FTP the files over to help avoid accidents and mistakes from going live in real-time.

jasper_
12-09-2008, 02:51 PM
not true. DW has a built in PHP parser, it just parses your files for you, on your local computer. It can do that without FTP details entered in the Site settings, so it cannot do that live.
Hit the button next to 'design' called "Live Data View"





__________________
J. August
Web

Mechphisto
12-09-2008, 03:00 PM
Huh. That opened up a little URL address bar.
Interesting.
OK, well, if this is the area I need to look for the answer in, I'll start looking there.
Thanks for the direction!
-Liam

Mechphisto
12-09-2008, 05:39 PM
OK, finally got a good reply from the Adobe forums:
While in the included page in the editor, in the CSS minimenu at the top-right, click the top-top-right option drop-down and select "Design-time...". Then apply the CSS.
Whammo! All my styles are available to select and use, and I don't have to worry about including additional half-broken paths in my pages!
Anyway, in case anyone else needs to know, there you go.