Smarty, custom tag highlight.

Is it real to add highlighting for custom tag in .tpl files?
For example, at the moment PHPStorm highlight in orange color that .tpl tags like {foreach... {if... e.t.c
But can i add my custom tag to highlighting? For example {t} ? I use gettext localization in Smarty, and all my text to translate puted into this tag, so is it real to add them into highlight rules?

Comment actions Permalink

Hi there,

TBH -- no clue.

On one hand, accordingly to (which is marked as fixed) all custom tags registered via register_compiler_function() should automatically be detected and treated as Smarty tags. I personally have never used any custom tags (only functions/modifiers) so cannot tell how it supposed to work (if at all).

But then we have another request: (still pending) which asks for custom colors for custom tags .. but still asking on a way of how to list such custom tags.

Right now I may suggest:
1) Configure your editor color scheme for Smarty to have some background color for the whole tag -- this way you could see that this is a tag more easily.
2) If no JB devs/support will reply here in a day or two -- submit another Feature Request ticket asking to provide a way of providing a list of custom smarty tags that will be treated in a same way as standard tags (i.e. highlighting the same color etc)

Comment actions Permalink

Hi, Andriy !
As always, you all know. :D Many thanks for answer. ;)

Comment actions Permalink


In our project we have custom Smarty tags:

//js code

is it possible to highligh code between those tags as JS?

Thank you.

Please sign in to leave a comment.