Transcluding Tiddler Content to a Different Tiddler Type (Rendering XML Tiddlers as Plain Text)

91 views
Skip to first unread message

Scott Simmons (Secret-HQ)

unread,
Mar 8, 2020, 6:43:53 PM3/8/20
to TiddlyWiki
Here's another issue I'm trying to tackle and hoping someone will share some insight:

I have several tiddlers of type "text/html" that contain XML files.  I like having them render out in the ViewTemplate in an iframe.  But occasionally I want to transclude them into another tiddler and have them show up as monospaced code, without being rendered.

I thought I could make a template tiddler and do something like this:

{{my XML tiddler||$:/xml-template}}

... but what should $:/xml-template look like?

Having it specify a different type ("text/plain") alone isn't enough to do the trick.

I've tried building a string from the content of [[my XML tiddler]] and wrapping it in <pre> and </pre> with no luck,

I'm pretty sure I'm stumbling all around an obvious solution and hoping someone else will see it clearly.

Saq Imtiaz

unread,
Mar 9, 2020, 6:48:08 AM3/9/20
to TiddlyWiki
Try using the ViewWidget and specifying the format: https://tiddlywiki.com/#ViewWidget

PMario

unread,
Mar 9, 2020, 4:39:02 PM3/9/20
to TiddlyWiki
Hi Scott,

If your template contains this:

<$view mode=text/>

It should do what you want.

mario

TonyM

unread,
Mar 11, 2020, 5:43:08 PM3/11/20
to TiddlyWiki
Mario

Is that technically correct?

I see mode= inline and block, and format=text ?

Regards
Tony
Reply all
Reply to author
Forward
0 new messages