How to transclude raw contents of a shadow tiddler

165 views
Skip to first unread message

talha131

unread,
Aug 31, 2020, 6:06:09 AM8/31/20
to TiddlyWiki

Is it possible to transclude the contents of a shadow tiddler?

I want to display raw contents of $:/core/ui/ListItemTemplate inside a tiddler.

I have tried

{{$:/core/ui/ListItemTemplate}}

<$transclude tiddler="$:/core/ui/ListItemTemplate" mode="block" />

One shows the link and other the output. Both does not show the content of the tiddler.

Why?

I am actually trying to document my TiddlyWiki configuration inside TW. I am trying to write a tiddler in which I describe what changes I have made in $:/core/ui/ListItemTemplate. It would be helpful, I can show the raw contents along with the description.

Saq Imtiaz

unread,
Aug 31, 2020, 7:17:20 AM8/31/20
to TiddlyWiki
Try this:

<$text text={{$:/core/ui/ListItemTemplate}}/>

talha131

unread,
Aug 31, 2020, 7:20:30 AM8/31/20
to TiddlyWiki

Thanks a lot, Saq. This fixed the issue

<pre>
<$text text={{$:/core/ui/ListItemTemplate}}/>
</pre>

TW Tones

unread,
Aug 31, 2020, 7:39:12 PM8/31/20
to TiddlyWiki
FYI:

If the shadow has being edited <$text text={{$:/core/ui/ListItemTemplate}}/> will show the updated content, not the original content.

To find the original content you can use the https://tiddlywiki.com/#subtiddlerfields%20Operator but you need to know the plugin it belongs to

Interactive access
  • Keep in mind that the editor preview has an option to compare the current overridden shadow with the shadow
  • The Info button on any tiddler > advanced tag tells you the status of shadow tiddlers.
Regards
Tony

talha131

unread,
Sep 1, 2020, 8:39:34 AM9/1/20
to TiddlyWiki

Keep in mind that the editor preview has an option to compare the current overridden shadow with the shadow

Thank you Tones. This is valuable. I was not aware of this feature.

TW Tones

unread,
Sep 1, 2020, 10:11:09 PM9/1/20
to TiddlyWiki
Talha

Your welcome, 

by the way

I said how 

To find the original content you can use the subtiddlerfields operator but you need to know the plugin it belongs to
Since we "need to know the plugin it belongs to

If you know the plugin eg core, [[$:/core]plugintiddlers[]]
Helps you find the "shadow" tiddlers within it

But if you know the shadow tiddler
and want to find its plugin source use the shadowsource operator

Regards
Tony

talha131

unread,
Sep 2, 2020, 4:35:28 AM9/2/20
to TiddlyWiki

Thank you Tones. For anyone else coming to this thread, this is how you can find the “plugin that contains a shadow tiddler”.

For example, to find the source plugin of $:/core/ui/ListItemTemplate, use this code

! Show Plugin that contains the Shadow Tiddler

<ul>
<$list filter="""[[$:/core/ui/ListItemTemplate]shadowsource[]]""" emptyMessage="(empty)">
    <li>
            <$link><$view field="title"/></$link>
    </li>
</$list>
</ul>

talha131

unread,
Sep 2, 2020, 4:42:31 AM9/2/20
to TiddlyWiki

Tones, can you please share an example of using subtiddlerfields correctly. This is what I have tried.

<ul>
<$list filter="""[[$:/core/ui/ListItemTemplate]subtiddlerfields[$:/core]]""" emptyMessage="(empty)">

    <li>
            <$link><$view field="title"  /></$link>
    </li>
</$list>
</ul>

It shows me “title” and “text”, but I cannot view the actual values of “title” or “text” fields.

Saq Imtiaz

unread,
Sep 2, 2020, 12:24:54 PM9/2/20
to TiddlyWiki
@talha131

The subtiddlerfields filter is supposed to do just that, give you a list of fields that exist in the subtiddlers of a plugin. So I am not entirely sure why you were pointed in that direction, maybe Tony had some other approach in mind that I cannot think of at the moment.

To see the original content of a shadow tiddler you can do this:

<pre><code>
<$view tiddler="$:/core" subtiddler="$:/core/ui/ListItemTemplate" />
</code></pre>

Or to see the diff between the current copy of the tiddler and the original shadow version:

<<compareTiddlerText $:/core $:/core/ui/ListItemTemplate $:/core/ui/ListItemTemplate>>

To compare all fields and not just the text:
<<compareTiddlers $:/core $:/core/ui/ListItemTemplate $:/core/ui/ListItemTemplate>>


Cheers,
Saq

TW Tones

unread,
Sep 2, 2020, 6:14:40 PM9/2/20
to TiddlyWiki
Funny;

<ul>
<$list filter="""[[$:/core/ui/ListItemTemplate]subtiddlerfields[$:/core]]""" emptyMessage="(empty)">
   
<li>
            <$link><$view field="title"  /></$link>
   
</li>
</$list>
</ul>
Worked for me

Sorry, Forgot to hit POST yesterday

We have to now ask for the content of the fields get operator, but we need the correct tiddler name te default., I will look closer later for you

Regards
Tony

talha131

unread,
Sep 6, 2020, 12:58:17 PM9/6/20
to TiddlyWiki

Thank you Saq. This was helpful. I ran it on a couple of shadow tiddlers and fixed my configuration using compareTiddlerText.

Reply all
Reply to author
Forward
0 new messages