Template and block mode for the current tiddler

I have a wiki where some tiddlers are automatically displayed with a dedicated template. This template adds some chrome around the content of the tiddler on display. That content can be wikitext, that needs to de interpreted on block mode.

I found out that in order to do that, the template has to code

<$transclude tiddler=<<currentTiddler>> mode=block/>

and not any of the following:

  <$transclude $field=text mode=block/>
  {{!!text}}

I can think that it has to be so but also it is not obvious. Should it really be so?

Hi @jypre

The reason that <$transclude $field=text mode=block/> doesn’t work as expected is that the presence of a parameter starting with $ triggers modern mode, which means that the mode parameter also needs to be passed as $mode.

The action of {{!!text}} depends on the context. On its own, with a blank line before and after, it will generate a block mode transclusion. Embedded in text, it will generate an inline mode transclusion.

Have a closer look at tw-com: “Legacy vs Modern Mode” – Modern mode should be considered best practice now.

There is some effort going on at the moment, to convert the TW core UI into “modern mode” using the TW v5.3.x syntax. – But this will take some time.

@jeremyruston I never read in the doc of the $transclude widget that being inn modern mode means all prameters were to be prefixed by $.

What I read is that any parameter being prefixed by $ means you are in modern mode. And no mention of $mode, only of mode.

@pmario Yes, I noticed that modern mode was now what should be used.

However, thanks to your help, my code is now in the new form and it works and I am relieved to know why!