Sasha


Search Cake CTP files with Dreamweaver

by Sasha

Occasionally I find it necessary to step in and make quick updates to source code for clients without disturbing or scheduling resources.

Most projects I’ve been involved with are Drupal and CakePHP based, more so on the CakePHP side lately, however their extensions (.ctp) aren’t picked up or searched by Dreamweaver so some configuration is required.

Step 1: Dreamweaver Extensions.txt file

Open the Extensions.txt file in Dreamweaver’s Configuration folder:

(MAC) Applications > Adobe Dreamweaver CS5 > Configuration > Extensions.txt

(PC) C:\Program Files\Adobe\Adobe Dreamweaver CS5

Step 2: Extensions.txt HTML Documents line

Find the line:

HTM,HTML,HTA,HTC,XHTML:HTML Documents

and append:

MODULE,THTML,CTP

so it looks something like this:

HTM,HTML,HTA,HTC,XHTML,MODULE,THTML,CTP:HTML Documents

Step 3: Extensions.txt PHP Files line

Then find the line:

PHP,PHP3,PHP4,PHP5,TPL:PHP Files

and append:

MODULE,THTML,CTP

so it looks something like this:

PHP,PHP3,PHP4,PHP5,TPL,MODULE,THTML,CTP:PHP Files

Step 4: Dreamweaver MMDocumentTypes.xml file

Next open the MMDocumentTypes.xml file in Dreamweaver’s Configuration > DocumentTypes folder.

Step 5: Update PHP_MySQL attributes

Find the line:

<documenttype id="PHP_MySQL" servermodel="PHP MySQL" internaltype="Dynamic" winfileextension="php,php3,php4,php5,inc" macfileextension="php,php3,php4,php5,inc" file="Default.php" writebyteordermark="false">

and modify to include MODULE,THTML,CTP:

<documenttype id="PHP_MySQL" servermodel="PHP MySQL" internaltype="Dynamic" winfileextension="php,php3,php4,php5,inc,module,thtml,ctp" macfileextension="php,php3,php4,php5,inc,module,thtml,ctp" file="Default.php" writebyteordermark="false">

Step 6: Save and restart

Be sure to save both files and restart Dreamweaver.

Dreamweaver will now recognize CakePHP files, particularly useful when doing a search of the Entire Current Local Site.

Find this useful? Share with someone now