Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Files with the extension ".inc": Syntax Highlighting and Code Formatting like ".php"?

Contributor ,
Apr 09, 2019 Apr 09, 2019

Hi.

For my PHP includes I use the file extension ".inc".

Is it possible to configure DW in a way, that he uses the same syntax highlighting and code formatting rules as for files with the extension ".php"?

Thanks.

1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 09, 2019 Apr 09, 2019

The old method will work for you then (I also use CC 2015 and have used it in the past) as shown here:

The file path for your personal config folder should be...

~/Library/Application Support/Adobe/Dreamweaver CC 2015/your language/Configuration

Modifying the Extensions.txt by adding INC to the PHP line, then the MMDocumentTypes.xml (adding inc twice to the php section), then removing the .inc from the Open in Code View under Preferences > File Types/Editors will do the trick.

Translate
Community Expert ,
Apr 09, 2019 Apr 09, 2019

I tend to name my include files as myfile.inc.php

Wappler, the only real Dreamweaver alternative.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 09, 2019 Apr 09, 2019

Yes. But I'm looking for that, what I described.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 09, 2019 Apr 09, 2019

Hi Mistershortcut,

Thank you for coming up on the forum with your question, as per your description you are trying to configure Dreamweaver in a way so that you can use the same syntax highlighting and code formatting for files with the .php extension.

In addition to what Ben has suggested if you want to customize the colors of your code elements in Dreamweaver, please check this link:-

Learn how you can customize the colors of your code elements in Dreamweaver.

If you want to set the coding preferences in Dreamweaver like code themes, format and code rewriting you can check this link as well:-How to set coding preferences in Dreamweaver

Please check if this helps you and let us know.

Regards,

Harshika

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 09, 2019 Apr 09, 2019

Thanks Harshika.

But I know how to customize an existing code library for colors or formatting.

What I'm looking for is way how I can make DW treat files with ".inc" equally to ".php", regarding color and formatting.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 09, 2019 Apr 09, 2019

What version of Dreamweaver are we talking about?

Paul-M - Community Expert
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 09, 2019 Apr 09, 2019

I'm not sure if this works in the latest versions, but this used to be the way to add new extensions to DW...

Add or edit recognized file extensions in Dreamweaver​

EDIT: I just tested in the latest version and the 3-step, old method at the top of the article still works, though the path to the personal configuration folder is slightly different.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 09, 2019 Apr 09, 2019

For latest CC 2019 this should work:

Copy this in a text file and name it main.js

define(function (require, exports, module) {

    var LanguageManager = brackets.getModule("language/LanguageManager");

    var language = LanguageManager.getLanguage("php");

    language.addFileExtension("inc");

});

You then need to navigate to your Brackets extenions folder, you've NOT stated your OS, this Is an example of the path on windows:

C:\Users\username\AppData\Roaming\Adobe\Dreamweaver CC 2019\en_US\Configuration\Brackets\extensions\user\

Create a folder inside the 'user' directory named something like inc_files and copy the main.js file you created into it.

Restart Dreamweaver if already running.

Paul-M - Community Expert
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 09, 2019 Apr 09, 2019

Thanks for your hints.

I use DW15 on macOS.

May be I will use DW19 in the future again, so my question refers mainly to DW15 but I'm intereste as well in solutions for DW19.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 09, 2019 Apr 09, 2019

The old method will work for you then (I also use CC 2015 and have used it in the past) as shown here:

The file path for your personal config folder should be...

~/Library/Application Support/Adobe/Dreamweaver CC 2015/your language/Configuration

Modifying the Extensions.txt by adding INC to the PHP line, then the MMDocumentTypes.xml (adding inc twice to the php section), then removing the .inc from the Open in Code View under Preferences > File Types/Editors will do the trick.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 09, 2019 Apr 09, 2019

@Jon

Your explanation was so helpful. It worked instantly.

How nice to view "*.inc" in that way! Great!

@Paul-M

Thank a lot too.

I will note that steps to my todo for DW 2019.

Have a nice day everyone.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2019 Apr 11, 2019
LATEST

you are welcome

Paul-M - Community Expert
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines