transclude variation of {{!!title}}

80 views
Skip to first unread message

Dave

unread,
Oct 6, 2018, 10:44:40 PM10/6/18
to TiddlyWiki
Hi, 

I'm trying to transclude both a tiddler and a related tiddler in a filtered table.  The main tiddler referenced by {{!!title}} works (it's an image), but the description stored in a "related" tiddler (named the same title, but with ".d" added to the name), so tiddlers e.g. [[Crunches]] and [[Crunches.d]]

Here's what I tried :

<table><thead><tr><td>Exercise</td><td>Picture</td><td>Description</td></tr></thead>
<$list filter="[tag[Yes]]"><tr>
<td><$link to={{!!title}}><$view field="title"/></$link></td>
<td><$transclude/></td>
<td><$transclude tiddler="{{!!title}}.d"/></td>
</tr></$list></table>

and this in the fifth row:


<td><$transclude tiddler="<<currentTiddler>>.d"/></td>


and this:


<td><$transclude tiddler="""<$list filter="[all[current]addsuffix[.d]">"""/></td>



but none of them work.

Any suggestions?  





Mohammad

unread,
Oct 6, 2018, 11:46:29 PM10/6/18
to tiddl...@googlegroups.com
Try this


<table><thead><tr><td>Exercise</td><td>Picture</td><td>Description</td></tr></thead>
<$list filter="[tag[Yes]]"><tr>
<td><$link to={{!!title}}><$view field="title"/></$link></td>
<td><$transclude/></td>
<$set name="desc" filter="[<currentTiddler>addsuffix[.d]]">
<td><$transclude tiddler=<<desc>>/></td></$set>
</tr></$list></table>



TonyM

unread,
Oct 6, 2018, 11:49:11 PM10/6/18
to TiddlyWiki
In cases like "<<currentTiddler>>.d" will not be wikified in a parameter unless they are inside a wikify widget. Try first to wikify it and put the new name in without quotes param=<<newvalue>>

The angle brackets in a way replace the " " to delimit the value. If you use " " it says it is a litteral string and returns it unevaluated.

You can also "concatinate" in macros

\define newvalue() <<currentTiddler>>.d

At the top of the tiddler.

Regards
Tony

Dave

unread,
Oct 7, 2018, 1:42:28 AM10/7/18
to TiddlyWiki
Thank you Mohammed, that worked perfectly!

Tony, I'd also like to get your version working as well, but I'm stuck.  This is what I thought should work:

\define newvalue() <<currentTiddler>>.d

<table>
<thead><tr><td>Exercise</td><td>Picture</td><td>Descript</td></tr></thead>
<$list filter="[tag[headache]]"><tr><td><$link to={{!!title}}><$view field="title"/></$link><br><<yesnotag>> </td>
<td><$transclude/></td>
<td><$transclude tiddler=<<newvalue>>/></td></tr>
</$list>
</table>

I also tried with double quotes in the macro and the transclude for good measure (even though I'm pretty sure you explained it wouldn't work in the transclude part)

I'll post if I stumble across the answer...

TonyM

unread,
Oct 7, 2018, 1:54:12 AM10/7/18
to TiddlyWiki
Sorry dave,

I responded on my mobile so did not re test as I usualy do on my desktop.

I will test when I can, but I said it with conviction because I truely believed it.

I will follow up.

Tony

TonyM

unread,
Oct 7, 2018, 11:00:17 PM10/7/18
to TiddlyWiki
Dave,

Working example of macro and wikify to concatenate text

Using the define we seem to need $(currentTiddler)$.d

\define newvalue() $(currentTiddler)$.d

eg

\define detailstiddler() $(currentTiddler)$.d


*<<detailstiddler>>
:<$transclude tiddler=<<detailstiddler>>/>


<$wikify name=details3 text="<<currentTiddler>>.d" >


*<<details3>>
:<$transclude tiddler=<<details3>>/
>
</$wikify>

Results in 

  • Test tiddler.d
Content of "Test Tiddler.d"
  • Test tiddler.d
Content of "Test Tiddler.d"


Regards
Tony
Reply all
Reply to author
Forward
0 new messages