Adding filetypes to Netbeans

I’ve been using Netbeans for web development with PHP for some time now and just keep on finding neat tricks. Most of the times I use TemplatePower for templating in my PHP applications. Your template files have to have the extension .tpl to work with TemplatePower. I had a problem with this because Netbeans didn’t recognize the files as html files (which they effectively are). There’s an easy way to fix this however, which works like this:

Go to Tools -> Options and click on ‘Miscellanous’. Now open the type called ‘File associations’. Click new, enter the extension for which you want to assign a file type and hit ‘Ok’. Now choose the associated File Type (MIME) that you want to go with this file extension. Done! You can do this for any file extension you want.

13 comments on Adding filetypes to Netbeans

  1. doesn’t work on netbeats 6.5.

  2. Hey Kara, it worked for me, what’s the problem?

  3. yeah, doesn’t work on nb 6.5. The problem is that there’s no type called “file associations”. or where exactly is it supposed to be?

    thanks in advance!

  4. Yes :) Thank you for this!

  5. The tab is “Files” and “File associations” is the first listed section

  6. Thanks Chris, that’s real helpful! :)

  7. Thanks!!!

  8. Thank you, this really helped.

    In 6.8 thou you can find the “File associations” in
    Tools -> Options -> Files tab

  9. thank you

  10. Hello, thanks, very good!

    I was looking fort that for a long moment!

    Good morning from france!

  11. bedankt man, eeuwen lopen zoeken hiernaar maar altijd over het hoofd gezien

  12. Any means of removing file extensions? (like php) :)

  13. It IS possible to change the MIME type association for (for instance) php files but it’s not possible to remove it from the list of supported file types. You could however use a regex pattern to make sure that php files are not visible in the projects folders. Go to Tools -> Options -> Miscellaneuous -> Files for these options.

Leave a response: