Display .tpl files as simple html+php files

I'm using a cms where template files have .tpl extension, but they don't use any templating engine like Smarty, those are just simple html and php code mix files. Currently those files are parsed as Smarty templates, so obviously they are full of erros and syntax coloring is wrong. I looked into Settings and found "Template Data Languages", i looked there for Php and didn't find it, so i've put HTml to see the results and nothign has changes, tpl files were still treated as Smarty templates. Don't know what was wrong. either my understanding of how that feature works or a bug...

So i thought of File Types section, however chnages there are applied globally, so having 10 projects were .tpl are Smarty templates and 1 project where .tpl is php templates makes me reluctant to make changes there.


Can you help me out with a solution for my problem?

0

Hi Alexei,

File | Settings | File Types.   Remove *.tpl pattern from "Smarty" and add it to the "PHP files"

That is the only known to me way of doing this.

1

@andriy you are a life saver... I spent a day trying to figure this out! :)

0

I think better option is to add *.tpl patterns to php File Types, instead of removing the smarty pattern from tpl files, in case you will need to work with smarty in future projects.

0

@Kloshar4o

>I think better option is to add *.tpl patterns to php File Types, instead of removing the smarty pattern from tpl files, in case you will need to work with smarty in future projects.

You cannot have the same pattern associated to different file types.

And you cannot make such associations project-specific (to have it as PHP file in one project and Smarty template in another). Watch these tickets (star/vote/comment) to get notified on any progress:

0

请先登录再写评论。