Click to See Complete Forum and Search --> : [Resolved] colours in dreamweaver MX


happyme
01-16-2003, 05:38 AM
Hi there,

I'm writing php code in dreamweaver and so long as I use a .php extension the code is diplayed in pretty colours which is easier to work with

As soon as I start using php4 extensions, as required by one of my servers, all the colours go. I can work with .php and rename to .php4 but it's a pain. How can I get Dreamweaver MX to recognise .php4 files as php?

Julia

mzanimephp
01-16-2003, 06:53 PM
I don't think thats possible... you may have discovered something that they left out. I have the 6.1 upgrade and this issue still isn't fixed.

It seems to interpret .php3 and .php4 extensions as regular text.

Sorry.

gecko498
01-24-2003, 04:50 PM
Actually, Dreamweaver is far more powerful than most know.

To see the pretty colours you need to define php4 as a PHP extension.

Open c:\Program Files\Macromedia\Dreamweaver MX\Configuration\DocumentTypes\MMDocumentTypes.xml

Look for winfileextension="php,php3" or macfileextension="php,php3" if you're on a mac and simply add php4 to the list so you have:

winfileextension="php,php3,php4"

Save it, and restart Dreamweaver and you should be good to go.

Cheers

mzanimephp
01-24-2003, 11:12 PM
Thanks for the tip. But that doesn't make Dreamweaver any more powerful than it was. Macromedia should've made that part of the program from the beginning.

For some of the less savvy developers (who barely know HTML) they would've been totally lost by this.

gecko498
01-24-2003, 11:54 PM
Originally posted by mzanimephp
Thanks for the tip. But that doesn't make Dreamweaver any more powerful than it was. Macromedia should've made that part of the program from the beginning.

For some of the less savvy developers (who barely know HTML) they would've been totally lost by this.

Perhaps. But, with much respect, I don't think you can blame the tool because you don't fully understand how to use it to it's potential.

I think the gang at Macromedia did a pretty stand up job on this one.

mzanimephp
01-25-2003, 12:09 AM
I agree with you, I think Macromedia did a excellent job on Dreamweaver MX. But I was still nontheless shocked when I noticed that php3 and php4 extensions were not color-coded by default.

I spent aleast an hour trying to find a way to color code them, searching through message boards, the macromedia site, and search engines, etc.

I was quite flustrated.

>>I don't think you can blame the tool because you don't fully understand how to use it to it's potential.

I don't blame the program. I know how to use the program better than most people I know, what I want to know is how you figured this one out.... if your like me, when you hear the word "XML" you shudder.

gecko498
01-25-2003, 12:25 AM
Originally posted by mzanimephp
But I was still nontheless shocked when I noticed that php3 and php4 extensions were not color-coded by default.


Well php3 is by default, but yes, it is a little odd that php4 isn't.


I don't blame the program. I know how to use the program better than most people I know, what I want to know is how you figured this one out.... if your like me, when you hear the word "XML" you shudder.

Well Dreamweaver is all based on templates, essentially every bit of code, and most components of the program are controlled by the program's templates. You can do lots of fun stuff by editing these templates.

For example when you click the Insert Image button, Dreamweaver grabs the code for the image tag from a file and inserts it. By editing that file you can customize what's inserted. The same principle applies to pretty much every element of the program. (Sidenote: Handy for authoring XHTML in previous versions of Dreamweaver).

I stumbled along this fix when I was trying to change the default extension for HTML files to .html from the default .htm (another wierd choice by Macromedia). FYI, in that same file if you change the order of the list for the HTML extensions you can change the default extension.

Lots of the Macromedia software operates much the same, including Fireworks and Flash. Don't be afraid to play around, it's worth it if you can make life easier for yourself, and you can alway reinstall if you screw something up.

Besides, it's fun :D

mzanimephp
01-25-2003, 12:29 AM
Thats incredible, thanks! :D

gecko498
01-25-2003, 12:37 AM
Hey, no problem ;)

mw-dnb
01-27-2003, 07:24 PM
Originally posted by mzanimephp
Thanks for the tip. But that doesn't make Dreamweaver any more powerful than it was. Macromedia should've made that part of the program from the beginning.

For some of the less savvy developers (who barely know HTML) they would've been totally lost by this.

I just wanted to comment that Dreamweaver isn't built for beginnners. I've been developing for the internet since 1994 and have see more than my share of html / php / cgi etc etc editors.

Macromedia Dreamweaver, in my opinion, stands stronger than any other application out there. It is built around ISO requirements. PHP4 file extension is not a standard, in fact I'm not sure if I have ever even seen someone use this extension for their applications.

The program itself is fully customizable, but that is a feature for advanced users or anyone who can read XML. Possibly dreamweaver should look into developing a beginners or intermediate level development studio, but I think as the applicaiton stands at the moment, with a little bit of research (just like this thread) you can make it do whatever you want. In fact you can almost rewrite the entire application.

I can't think or name many if any other applications that allow you to have that open ended feel. Sometimes dumbing things down and making them easier is counter productive, at least when your target audience are proffesional developers and web designers - not the common web user or part time internet developer.

mzanimephp
01-27-2003, 09:06 PM
Aye. But some tend to stay in WYSIWYG view more than they should.

yoyo
05-08-2003, 01:49 AM
Originally posted by mw-dnb
PHP4 file extension is not a standard, in fact I'm not sure if I have ever even seen someone use this extension for their applications.


You need to use the php4 ext if you install the PHakt server extention in dreamweaver to allow more than just MySql database support with php. That's the only time i've needed it.

FrozNic
05-08-2003, 02:49 AM
that's the sad thing about people these days... they have to have everything easy... if you're going to program DO NOT try and take the easy way.. (wysiwyg) besides, if you don't understand the code to begin with what the heck are you building webpages for :) dwmx has won my #1 fav program award :) cept for it's unreal memory hogging, but, i can live with that with the power it has. from modules to templates that thing owns me! an why would u shudder and xml? it's almost easier to read then html :) peace

Boudga
06-25-2003, 02:01 PM
you can always drop out to the shell and:

shell>ren *.php *.php4

From the directory containing all the php extensioned files that need converted to php4 extensions...this is what I do and it takes a matter of seconds.

mzanimephp
06-25-2003, 03:17 PM
Also, I did not know this many moons ago when I first posted to this thread. But you can easily add new file types inside the DWMX preferences. Just click on:


"Edit" > "Preferences" (select) File Type/Editors

Then add .php3 and .php4 to open in code view, and below, add .php3 and .php4 to be opened primarily with DWMX.

Happy coding. :)

FrozNic
06-25-2003, 03:18 PM
lol, didn't even think about that ;)

dumdumdaniel
07-14-2005, 08:23 PM
Howdy guys,

sorta related to this...

we have a content management system that takes htm file as templates. unfortunately, I dont have a choice in the extension, it was somethign that was developed long before i was employed here.

in these templates we can have php which is parsed, but in regular html files, the coloring is all messed up. i tried removing htm and html from the HTML document type in MMDocumentTypes.xml and puttin them in PHP_MySQL

DW loads ok, but it crashes as soon as it's done loading... i'd love to be able to change the file extension i use, but i dont have any choice... any thoughts?

i started exploring PATHTODW/Configuration/CodeHints/CodeHints.xml but i dont really have any time to experiment...


cheers...

dumdumdaniel
07-14-2005, 11:47 PM
To have html correctly color highlight PHP code in a HTM/L file you need to alter an xml file called CodeColoring.xml

If yer using winxp/2k

1.
goto c:\Documents and Settings\[YOURUSERNAME]\Application Data\Macromedia\Dreamweaver MX[ 2004]\Configuration\CodeColoring\

2.
copy CodeColoring.xml to CodeColoring.notxml

3.
search for
doctypes="PHP_MySQL"
and add
,HTML

it should look like doctypes="PHP_MySQL,HTML"

done! this will make html files highlight yer php…



some other time, when I have the time, I’ll look at bringing in the auto-completion, etc, as that sort of functionality is more complicated and not entailed in coloring…

dumdumdaniel
07-15-2005, 12:02 AM
ok... scratch that last comment...



i've got the default code hinting/completion in htm files now too...

1
goto your DW installation and configuration folder:
c:\Program Files\Macromedia\Dreamweaver MX 2004\Configuration

2
go into the CodeHints folder
rename CodeHints.xml to CodeHints.notxml, just to keep a backup and stop DW from using it

3
open the CodeHints.xml file and do the same as i mentioned in the post above...
search for
doctypes="PHP_MySQL"
and then add
,HTML to it . it should look like doctypes="PHP_MySQL,HTML"

4
restart Dreamweaver

Rodney H.
07-15-2005, 02:36 PM
Also, have you all messed around with the SNIPPETS possibilities? If you use code over and over again, you can create custom snippets and save them in your config/snippets folders and just drag and drop them on the page where you need that ever re-usable line of code. It is truly miraculous what you can do if you "open up the hood" of DW!