Smarty, custom tag highlight.

Hello!
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?



Attachment(s):
se.PNG
5 comments
Comment actions Permalink

Hi there,

TBH -- no clue.

On one hand, accordingly to https://youtrack.jetbrains.com/issue/WI-1109 (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: https://youtrack.jetbrains.com/issue/WI-21389 (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)

0
Comment actions Permalink

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

0
Comment actions Permalink

Hello,

In our project we have custom Smarty tags:

{ia_add_js}
//js code
{/ia_add_js}

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

Thank you.
0

Please sign in to leave a comment.