Menu

Associating web(html) script with a language

2008-03-26
2012-11-14
  • Nobody/Anonymous

    Hello,

    I've added a smarty (.tpl) file to my Notepad++ and now I'm trying to make .html and .js syntax highlighting work in .tpl files.

    What I mean by this is: when you view php code in Notepad++ and there is some html and javascript in the page, syntax highlighting will appear for php, html, and javascript (in their appropriate sections).

    I am attempting to do the same from a smarty file where you might have all 3 PLUS the smarty syntax. However, I have not been able to find where this is.

    I found a section in Preferences > File Association where there is an entry under "Supported exts" for "web(html) script" and extensions such as .js, .html, .php are in that category. However, I cannot edit that category to add the .tpl (smarty) extension.

    Is this the right approach?

    If so, how do I edit this section.

    If not, what do I need to do to make .tpl have html, js, php highlighting?

    Please help :)

     
    • Harry

      Harry - 2008-03-26

      In the styler configurator, you can add your own extensions so those files get opened in that language auytomatically.
      However, you cannot combine smarty and PHP/HTML/Javacript together, you can only adjust the keywords of those languages that already exist.

       
  • Anonymous

    Anonymous - 2009-12-02

    Hm, exactly the same problem. Cant work out this GUI.

     
  • cchris

    cchris - 2009-12-02

    Smarty is a user defined language, as far as Notepad++ is concerned, and so does not support embedded scripts the way PHP does.

    A way out, but it is hardly practical, would be to rip the LexHTML.cxx source file and turn it into the source for an external lexer, ie a plugin dll adding support for the language. If you know how to make a dll - it does not need to be written in C++ -, then you can have a go at this.

    CChris