I'm trying to apply a modifier (truncate, in my case) to the output of a block (a tr block, that is, a translation block). I don't have tr as a modifier because it's not convenient for HTML markup.

I don't really know what kind of syntax I should use, nor if it's allowed (given, my usage of blocks might be a bit funky).

Something like that, if it makes any sense:

{{tr}Really long text I want to be translated then truncated{/tr}|truncate}

Accepted Answer

It could be done like this:

{capture assign="var"}{tr}...{/tr}{/capture}

But I personally would create truncate block function and do this

Written by Gedrox
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki