of interest: transclusion and field of transcluded tiddler

71 views
Skip to first unread message

Jean-Pierre Rivière

unread,
Apr 21, 2021, 6:45:24 AM4/21/21
to TiddlyWiki
I have acollection of tiddlers that have a field name "importantt".

I display this field with {{!!important}} within each of these tiddler.

and I have an other tiddler that display a collection of those tiddler thanks to a list widget and a transclude widget. But when transcluded, the important field was nos shown.

I have not set up a template for inclusion so far and probably won't.


For in my list widget I use a "journal" variable to list each tiddler I want to show. And there is no such "journal" variable or macro in each of every targeted tiddlers.

So now, in every of those tiddlers, I make my transclusion as

<$transclude tiddler=<<journal>> field=important/>

instead of

{{!!important}}

and this works OK when each of those tiller is on display by itself or transcluded by my library tiddler.

to be complete:

in "outer" tiddler:
<$list variable=journal filter="[tag[journal]]">
<details>
  <summary><$link to=<<journal>>/> <span><$transclude tiddler=<<journal>> field=important mode=inline/></span></summary>
  <$transclude tiddler=<<journal>> mode=block/>
</details>
</$list>

in each inner tiddler (tagged "journal" and with an "important" field):
<$transclude tiddler=<<journal>> field=important/>

Thank you to all PMario and Tobias Beer. I hope this post could help further people with a quicker access to a solution to a simple but frequent problem.

Mohammad Rahmani

unread,
Apr 21, 2021, 8:35:21 AM4/21/21
to tiddl...@googlegroups.com
I believe in

<$list variable=journal filter="[tag[journal]]">
<details>
  <summary><$link to=<<journal>>/> <span><$transclude tiddler=<<journal>> field=important mode=inline/></span></summary>
  <$transclude tiddler=<<journal>> mode=block/>
</details>
</$list>

You will get the same result using shortcut transclusion in double curly brackets, if you remove the tiddler or leave it to be currentTiddler

<$list filter="[tag[journal]]">
<details>
  <summary><$link/> <span>{{!!important}}</span></summary>
  {{!!text}}
</details>
</$list>

So, {{!!field}} will work as long as you refer correctly to currectTiddler!
Sidenote: I myself prefer the first implementation (your solution) as it is a semantic and clear one! In programming I myself prefer to write codes that are maintainable and understandable and self explanatory!


Best wishes
Mohammad


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/934e4e5a-9ef7-4be8-a9c3-f5c5f964b400n%40googlegroups.com.

Mohammad Rahmani

unread,
Apr 21, 2021, 8:37:22 AM4/21/21
to tiddl...@googlegroups.com
Correction

 if you remove the tiddler or leave it to be currentTiddler

I mean variable!

Best wishes
Mohammad

Jean-Pierre Rivière

unread,
Apr 21, 2021, 8:50:03 AM4/21/21
to TiddlyWiki
Yes, you're right and your code works. But I never use a list widget without an explicit loop variable. As you wrote, it makes for more easy to decipher code. It is those kinds of implicit stuff that can make Perl code so short but so arcane. This is the origin of my aversion for them.

PMario

unread,
Apr 22, 2021, 12:16:18 AM4/22/21
to TiddlyWiki
Hi,
Well written!

On Wednesday, April 21, 2021 at 12:45:24 PM UTC+2 jn.pierr...@gmail.com wrote:
....
Thank you to all PMario and Tobias Beer. I hope this post could help further people with a quicker access to a solution to a simple but frequent problem.

You are welcome!
It feels good to know, that things that I wrote actually helps users to improve their wilkis.
-m
Reply all
Reply to author
Forward
0 new messages