Put your message here! Contact me for more information
 
 








 

if($p) {adsense_deluxe_ads(”);}Opening files with different custom extensions in DreamWeaver is pretty annoying: it’ll ask you for the external edit after shouting out the complain. And yes, after you configure Dreamweaver to open the file (through **Edit > Preference > File Type/ Editors**), you only get a plain Code view of the file. **Where the @#$@#$ is the Design View?** And you are working on the next killer template for a site but the template just happens to be of extension ***.thml**. In this case, I’m talking about **CakePHP**. Its default template extension is ***.THTML**. But don’t worry, be happy. Here is the solution to enable DreamWeaver Design View for any custom filetypes, and ***.THML** in particular.

**Now take a deep breath, I know you’ve been waiting for this answer. I know I have.**

- Go to **[Your_Drive_Here]:\Program Files\Macromedia\Dreamweaver MX 2004\Configuration\**
- Open the file **Extensions.txt** and add your custom extensions to the list. Remeber, in **Extensions.txt**, it’s got to be all CAPS. For **CakePhp**, add **THML** to the first line (the one ends with :All Documents) and the **16th** line of the PHP group. Here is the code for the Extensions.txt fileHTM,HTML,SHTM,SHTML,HTA,HTC,XHTML,STM,SSI,JS,AS,ASC,ASR,XML,XSL,XSD,DTD,XSLT,RSS,RDF,LBI,DWT,ASP,ASA,ASPX,ASCX,ASMX,CONFIG,CS,CSS,CFM,CFML,CFC,TLD,TXT,PHP,PHP3,PHP4,PHP5,TPL,LASSO,JSP,JSF,VB,VBS,VTM,VTML,INC,JAVA,EDML,WML,THTML,INC:All Documents
HTM,HTML,HTA,HTC,XHTML:HTML Documents
SHTM,SHTML,STM,SSI,INC:Server-Side Includes
JS:JavaScript Documents
XML,DTD,XSD,XSL,XSLT,RSS,RDF:XML Files
LBI:Library Files
DWT:Template Files
CSS:Style Sheets
ASP,ASA:Active Server Pages
ASPX,ASCX,ASMX,CS,VB,CONFIG:Active Server Plus Pages
CFM,CFML,CFC:ColdFusion Templates
AS:ActionScript Files
ASC:ActionScript Communication Files
ASR:ActionScript Remote Files
TXT:Text Files
PHP,PHP3,PHP4,PHP5,TPL,INC,THTML:PHP Files
LASSO:Lasso Files
JSP,JST:Java Server Pages
JSF:Fireworks Script
TLD:Tag Library Descriptor Files
JAVA:Java Files
WML:WML Files
EDML:EDML Files
VBS:VBScript Files
VTM,VTML:VTML Files
As this first step is just for Dreamweaver to recognize the new file extensions, we have to further edit another config file.
- Go to the **DocumentTypes** folder (still in the same path), edit the file **MMDocumentTypes.xml**\\ (fullpath: [Your_Drive_Here]:\Program Files\Macromedia\Dreamweaver MX 2004\Configuration\**DocumentTypes\MMDocumentTypes.xml**) with a Text Editor (i.e. Notepad or Notepad++). It’s not advisible to edit this particular xml file with Dreamweaver as the software may go crazy as it’s being used to edit itself.
- Go to l**ine 67**, add the THTML extesion to the **winfileextension** and **macfileextensionlist** attributes. Here is the code exerpt

<br /> <MMString:loadString id="mmdocumenttypes_14" /><br />





- Restart DreamWeaver, then open the .thml of CakePHP. Voila! It’s working! Yay! No more blind-coding.

=== Final Remarks ===

I hope you enjoy the tip. To consult the original documentations, please visit [[http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16410|Dreamweaver Technote: Changing and adding file extensions recognized by Dreamweaver MX]]. if($p)adsense_deluxe_ads(’MediumRectangleLeft’);My final take on this: Dreamweaver is an excellent tool, but the engineers did short of this very important features. Why is it not easier to assign a file extension to be opened with the Design View? Frontpage’s been doing it for years! I don’t know what is the problem with the Dreamweaver team but this is just plain dumb. Sorry, it’s pretty dumb - and it actually managed to be looked over during the user testing. Amazing. But how hard is it to include the new assignment in the GUI? Not that hard at all. -1 for you Dreamweaver!

Anyway, now with the THTML file is through, good luck with CakePHP. Please design the next killer websites to take back the glory for PHP from the RoR crowd.


 

43 Responses to “Dreamweaver MX Design View and CakePHP’s THTML



Ritesh
12:04 pm
August 24, 2006
#119

hi,

I tried adding thtml extension to both the documents, but still in dreamweaver I am not able to open thtml in design view. It is only showing code view.

Any idea why this is happening. I am using Dreamweaver MX 2004.

Regards,
Ritesh




3:40 pm
August 24, 2006
#121

@Ritesh,

you can try the same steps as above, but this time, edit this file

[Your_Drive_Here]:\Documents and Settings\Your_Login_Name\Application Data\Macromedia\Dreamweaver MX 2004\Configuration\Extensions.txt

This file is your profile-specific configuration. So all you have to do is to add the THTML extension in the right place

If nothing works, then start with a fresh installation of DreamWeaver, then proceed with the above steps and things will work just fine.

Hope that helps.

Cheers!




4:22 pm
August 29, 2006
#208

After basing my entire site with templates I found out that Dreamweaver does not support adding new (Javascript) pop-up menus in a template. The existing pop-menus work (using absolute links), and I can even add or subtract from an existing pop-up menu. So why can’t I add a new pop-up menu in the template?
I found this informations on httP://www.free-dreamweaver-templates.org.
Is there a workaround, without having to create all-new templates from standard pages?




11:14 pm
September 3, 2006
#335

SpecialMe,

I’m sorry that I don’t have enough expertise on DW’s template system. I just never use that feature. If I were you, I would digg through the Macromedia Docs would probably help, but that for sure will take a while.

Alex




Tom
10:09 pm
November 25, 2006
#2740

Worked like a charm, thanks! The only thing I had to do was also add .thtml into the “open in code view” field under “Preferences > File Types / Editors” at the end of the list of space separated extensions. This is sooooo much nicer and less of hassle than renaming files back and forth a million times. Yay Cake and I’m definitely in the PHP camp over RoR…Too many languages out there and when it gets to the internet…there has to be some lines drawn for standards…and well RoR is kinda out of that loop/popular crowd. Thankfully.




11:36 am
November 26, 2006
#2742

Very strange, but dreamweaver doesn’t let me search in .thml files, it just ignores those files. Anyone have any ideas?




[…] Being that I still occasionally dabble in Dreamweaver, I found this blog entry to be quite useful for opening THTML extensioned files in Dreamweaver. http://alexle.net/archives/119 […]




Alexandre Hudelot
3:34 pm
January 2, 2007
#11944

Thanks, saved me some time !

As Tom stated, it is necessary to add the .thtml extension under preferences > file types/editors before it works though.




Poonam
5:28 am
January 24, 2007
#14418

Thnks , It worked .




wyldie
2:17 pm
February 3, 2007
#15513

Another - and personally hassle free - way to make your templates editable in Dreamweaver (any version) is to create your files with the “.html” extension and in the “app_controller.php” of your Cake app add “var $ext = ‘.html’” to override the stupid “.thtml” extension…. In any case version 2 of cake will be using “.ctb” .. stupid!

Hope that clears this little issue up.




5:20 pm
February 14, 2007
#16428

Thanks very much for this — it worked perfectly and saved me from what would certainly have been a very frustrating discovery process.




7:43 pm
February 14, 2007
#16435

@canton,

You’re very welcome! I’m glad that it works out well for you.

Alex




programmer
10:12 am
February 22, 2007
#16935

i know it would sound stupid..
but i can only see the #include file of a webpage in the design view in dreamweaver 8 . like abc.asp has xyz.asp.. and some design codes and tables..
but when i view abc.asp in dreamweaver8 all i see is the include file.. not the whole abc.asp webpage..
its wierd .. but i dunno what to do..to it..
may be cos i m new…
any help will be appreciated..
thanx




10:39 am
February 22, 2007
#16936

@programmer

Just to make sure that I understand your question: you have abc.asp include the file xyz.asp. You can see the render version of the abc.asp and its include file in the Design View in DW8. Your problem is why is that when you are in Source code mode, you only see the source of abc.asp and not the xyz.asp? Or you can only see the code from xyz.asp but not the code in abc.asp?

My only suggestion right now is that you try opening up the files in notepad (no fancy WYSIWYG stuff) and see anything weird happens.




programmer
11:32 am
February 22, 2007
#16937

i can only see the code from xyz.asp which is included in abc.asp… but when i see the code view.. instead of design view ..everything seems fine to me and page displays perfectly online.. except few tags in the code view that it says invalid markup…i was able to see the tables in design mode easily .. the display was good while i was designing .. without changing any settings in dreamweaver .. it just stopped letting me see the layout..i know what i see i can never get in design view.. but .. its so easy to place flash animation in design view than in code view.. no its not that i m lazy .. its just that .. the column that i left unfilled for flash files need more and more columns within them… for me to place the flash files.. and thats where i need the design view.. so i may know .. if the flash file is placed in the right column..
sorry if i m confusing you..
hope you understand now..what i mean




programmer
11:47 am
February 22, 2007
#16939

Press SPACEBAR or ENTER to activate and use this control.

how do i fix this Alex??
i need to click twice on my flash to go to a link..

guess its not my day today…
* *
~




12:03 pm
February 22, 2007
#16946

@programmer

He he … sometimes I feel that way too. Not every day is yours :)

First, don’t rely on the the Design View in DW. Since you have asp code behind, DW can mess up asp script when you move/ delete/ add new elements using the Design View. So you have to be extremely careful when you delete/ move elements using Design View. Always double check the code view to make sure DW is doing what you want it to do.

I guess the problem must be that you have some ASP code to generate the layout, so you are writing some layout code to the page. Unfortunately, DW will interpret all the tags it can see in Design View, thus messing up the render. It’s not too much that you can do in this case but debug the result HTML using source view.

Another way to solve this is to create a new static HTML page with the layout code and work on placing the flash file in this page. When you are done, just copy/paste the static layout code back to your ASP page and be done.

Nonetheless, I highly suggest that you invest a day or 2 into learning layouting with CSS to spare you from using Table.

About the issue of “SPACE BAR” or ENTER, are you in DW, or are you preview it in IE? One thing, if you are previewing the page locally, e.g. via file:///C:\path…\file.html, then IE becomes paranoid and blocked all ActiveX control. Flash Player is an ActiveX so you have to confirm that to IE that you want to run it (stupid, I know). It’s likely that local security and permission is the issue here.

Best of luck!




programmer
12:12 pm
February 22, 2007
#16947

you know.. when i see in other forums..
they say thats because of the win xp new update that this thing appears.. and they have suggested a set of js codes to avoid the spacebar and enter thingy..
but i have aound 150 webpages… i know i can make on .js file and then call it in pages.. but .. 150 pages .. is not less..even to add…Bill Gates doesnt like to see programmers resting…
anyhow..
you are right i have to learn layouting with css … but playing with tables is fun… hehe.. j/k
thanx Alex..
i really appreciate it..
:)




7:26 am
March 27, 2007
#20083

Thanks for the Tip. Works Fine!
:D




11:08 am
April 5, 2007
#22171

It works! Congratulations!




8:29 pm
April 6, 2007
#22387

Your a legend, thanks alot… that was really begining to piss me off




10:52 am
April 17, 2007
#23632

Works great in dreamweaver 8 also. Good job dude!




wils1955
4:11 am
April 20, 2007
#23869

DW8 keeps loading .ssi and .sssi files in code view only, Do I need to edit the Extensions.txt and MMDocumentTypes.xml and if so can you give some guidance to a novice trying to help a friend.




8:53 am
April 20, 2007
#23884

@WILS1955

The same fix can be applied for both .ssi and .sssi file extensions to have DW open the files up in the Design View. Instead of putting .THTML, put .ssi and .sssi.

Good luck!




wils1955
4:20 am
April 25, 2007
#24958

The second part of this fix in MMDocumentTypes.xml, do I need to do anything there. Also, do I need to add these extensions to the php line




9:08 am
April 25, 2007
#25039

@wils1955

The purpose of putting the extension to the “php line” is to let DW know to open the file in the PHP editor mode (so that you can have the intellisense/auto-complete popup). But if your SSI/ SSSI files are just HTML, or ASP scripts, you can skip adding to the PHP section and add to the HTML or ASP section instead.

Best of luck!




aparna
5:43 am
April 30, 2007
#26966

GIVE ME GUIDELINE TO WORK UPON CAKE FRAMEWORK.




wils1955
2:22 am
May 2, 2007
#27249

I have tried doing all that you suggest but these files still load as code. I must be doing something wrong, but I’ve no idea what, except I may have gone wrong in the MMDocumentTypes.xml
part of the fix. Any more help you can offer.




CherylP
4:10 pm
May 24, 2007
#31535

Thanks so much. I knew it could be done and had set it up before, but the file got corrupted and I couldn’t remember where to add the extensions! Thanks to the webdiva who pointed me to this solution. My day just got easier.




Bunter
12:05 pm
May 31, 2007
#33527

Thank you, you saved me a lot of time.
But in my case, I already added the .thtml string under edit/pref/filetype/editor by my self trying to make this work and your tip didn’t worked in the first time. But after i deleted the “.thtml” string again under preferences it worked for me.
So Thank you for the tip




Mudassar
6:51 am
June 1, 2007
#34001

Hi as a newbie to to cakephp i admired it a lot but the thtml plain code view in dreamviewr was the most annonying thing i encountered , but this helop a lot

Regards




DK
1:23 am
June 22, 2007
#40544

Thanks man this was beginning to drive me crazy.




6:50 am
August 6, 2007
#48657

Hi..
Thanx 4 the tip. I was searching it for last 1 month.
Once again thankyou very much :)




8:50 am
August 12, 2007
#49306

Vista has a security layer that make it hard to edit files in the “Program Files” folder. You can get around this by creating a link to exploer.exe, then right clicking on the link and selection “Run as administrator.” Now you can edit files via this instance of explorer.




5:31 am
September 9, 2007
#55698

Dreamweaver CS3で.thtml(CakePHP)の拡張子を編集できるようにするTIPS…

Dreamweaver CS3でデフォルトでは非対応の拡張子を開きたいとき, た……




John
1:10 pm
November 27, 2007
#82329

Perfect, works in CS3 version too. But not on line 67 anymore. Just search for the bit:

winfileextension=”php,php3,php4,php5″

Thank you.




12:44 pm
December 6, 2007
#85474

Thanks! (I foolishly searched the DW documentation to find this before resorting to Google!). Stupid, stupid omission (and still the case in DW CS3).




6:47 pm
December 6, 2007
#85530

just what i needed, thanks




Ben
8:09 am
January 29, 2008
#108196

LIFE SAVER, MAN!!! LIFE SAVER!!!!!!

Though, nowadays, Cake’s extension is CTP and not THTML… :)




Ben
8:14 am
January 29, 2008
#108201

P.S.

You should probably rename this post to “Dreamweaver Design View and Code Highlighting for any file extension”, as this will actually work with DW CS3, any file extension, and in Code Highlighting as well.




2:12 am
February 18, 2008
#118187

Hi,
You are a great man. you help me a lot
Many many thanks

Moynul




Russel
7:54 am
March 26, 2008
#134423

Thanks for the solutions.




Ann
9:36 am
February 3, 2009
#245106

Thank you! I used it to extend the Design view to PHP5 files, as looking at the code view only was driving me crazy. Thank you thank you thank you!




 

Leave a Reply