[TW5] TranscludeWidget vs. transclusion in WikiText

724 views
Skip to first unread message

cmari

unread,
Mar 3, 2014, 2:10:48 PM3/3/14
to tiddl...@googlegroups.com
Hi all,
The mode option in the TranscludeWidget (which is great!) allows something like this in a tiddler:

Some text <$transclude tiddler="A" mode="block"/><$transclude tiddler="B" mode="block"/> and even more text.

I tend to prefer block transclusion, which made me notice that the documentation for using WikiText
(http://tiddlywiki.com/static/Transclusion%2520in%2520WikiText.html)
doesn't really make clear that achieving the same effect without the widget, as best I can tell,
requires the not entirely intuitive procedure of listing the transcluded tiddlers on separate lines
(with no trailing spaces, and preceded by an additional blank line):

___________________________
Some text

{{A}}
{{B}}
 and even more text.
_________________________


So two things:
1. perhaps the documentation could be updated, and
2. perhaps there could even be built-in templates to allow for something like {{A||block}} vs. {{A||inline}}?
(or 3, I'm sure cleverer people will think of even better ideas and/or correct my misunderstandings).
cmari


PMario

unread,
Mar 3, 2014, 4:49:32 PM3/3/14
to tiddl...@googlegroups.com
On Monday, March 3, 2014 8:10:48 PM UTC+1, cmari wrote:
So two things:
1. perhaps the documentation could be updated, and
2. perhaps there could even be built-in templates to allow for something like {{A||block}} vs. {{A||inline}}?

That's actually the way it works.

create a tiddler named: block    wiht the following line content.

<$transclude mode="block"/>


now you can do {{a||block}} {{b||block}}   inline is not necessary, because it is default.

-mario

cmari

unread,
Mar 3, 2014, 6:02:48 PM3/3/14
to tiddl...@googlegroups.com
Thanks Mario!  I did realize that I could create a template for myself, but as it's taken me some time to figure out templates I guess I was starting to wonder how much TW5 users should be expected to need to learn - whether perhaps there are some common templates that could be standard?  Or at least collected in an obvious place, with clear instructions for how to deploy them.
cmari

Danielo Rodríguez

unread,
Mar 3, 2014, 6:42:04 PM3/3/14
to tiddl...@googlegroups.com
What is the block mode useful for?

Matabele

unread,
Apr 18, 2014, 5:00:24 AM4/18/14
to tiddl...@googlegroups.com
Hi

Having  similar problems - transcluding a tiddler by name through wikitext works as required:

{{myTiddler}}

However, I wish to transclude the tiddler named in a field: tiddlername with content 'myTiddler' (which I can't get to work in wikitext.) 

I therefore write:

<$transclude tiddler={{!!tiddlername}} mode="block" />

Which almost works -- that is, the wikitext transcludes correctly, but references to fields called within myTiddler do not display.

What is the correct syntax for the TranscludeWidget -- exactly equivalent to the wikitext version {{myTiddler}}?

regards

Danielo Rodríguez

unread,
Apr 18, 2014, 5:35:49 AM4/18/14
to tiddl...@googlegroups.com
That's because using {{}} for transclusion is like opening a window to myTiddler, you see it in its original state. In the other hand using the transclude widget is like inserting the content of the transcluded tiddler into the current one. That means that references to fields are pointing to the current tiddler and not the original one.

You should use macros

Define transcluder (title) {{$(title)$}}

And then
Transcluder({{!!tiddlertitle}})

Matabele

unread,
Apr 18, 2014, 6:36:12 AM4/18/14
to tiddl...@googlegroups.com
Hi Danielo

Thanks -- I have it at last:

\define linkTiddler(mytiddler) {{$mytiddler$}}

<$macrocall $name="linkTiddler" mytiddler={{!!tiddlername}} />

regards

On Monday, March 3, 2014 9:10:48 PM UTC+2, cmari wrote:

Jeremy Ruston

unread,
Apr 18, 2014, 7:22:45 AM4/18/14
to TiddlyWiki
Hi Matabele

The transclude wikitext syntax actually generates a combination of the tiddler widget (to set the current tiddler) and the transclude widget (to do the actual transclusion). You can fix things by wrapping your transclude widget in a tiddler widget.

Best wishes

Jeremy



--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Matabele

unread,
Apr 18, 2014, 8:58:14 AM4/18/14
to tiddl...@googlegroups.com
Hi 

Thanks -- the 'official' equivalent of a wikitext {{myTiddler}} is thus:

<$tiddler tiddler={{!!tiddlername}}>
<$transclude mode="block" />
</$tiddler>

Where the field 'tiddlername' contains the string: myTiddler

regards

On Monday, March 3, 2014 9:10:48 PM UTC+2, cmari wrote:
Message has been deleted

Jeremy Ruston

unread,
Apr 18, 2014, 10:15:40 AM4/18/14
to TiddlyWiki
Hi Matabele

On Fri, Apr 18, 2014 at 2:59 PM, Matabele <matabe...@gmail.com> wrote:
Problem -- with the 'official' equivalent -- when I now press the hamburger button, the content of the transcluded tiddler disappears. 

This does not happen with the macro version.

Strange. The hamburger icon flips the content of $:/state/sidebar between "yes" and "no". It's not obvious why it would make the content of the transclusion disappear. Can you share some code?

Best wishes

Jeremy
 

regards

On Monday, March 3, 2014 9:10:48 PM UTC+2, cmari wrote:

--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Matabele

unread,
Apr 18, 2014, 10:19:40 AM4/18/14
to tiddl...@googlegroups.com
Hi

Problem -- with the 'official' equivalent -- when I now press the hamburger button, the content of the transcluded tiddler disappears.

This does not happen with the macro version.

regards

Matabele

unread,
Apr 18, 2014, 10:49:30 AM4/18/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi

I have a standard report template which contains little other than a transclusion of a report -- the name of the report to transclude is stored in a field. This removes the tag pills from the printed report and allows for a standard header for the report other than the name of the report (which varies.)

My first version used a wikitext {{myReport}} -- this works fine.

Now I wish to store the name of the report being transcluded in a variable -- the macro version using a wikitext transclusion works fine:

\define transcludeTiddler(mytiddler) {{$mytiddler$}}

<$macrocall $name="transcludeTiddler" mytiddler={{!!tiddlername}} />

- where the field 'tiddlername' contains the title of myTiddler

The suggested equivalent, however, fails when the hamburger icon is clicked:

<$tiddler tiddler={{!!tiddlername}}>
<$transclude mode="block" />
</$tiddler>

The transcluded report itself contains similarly transcluded sections. The nested transclusions work in normal mode (although the transclusions collapse if I open another tiddler - thus changing the current tiddler) -- and also collapse when I press the hamburger icon.

This behaviour is consistent both for the doubly nested transclusion of the standard report template and for the singly nested transclusions of the sections of the report itself.

This does not occur when I use the macro version (which uses wikitext transclusions.) It appears that the wikitext transclusion does not suffer when the current tiddler changes, which appears to be the case when pressing the hamburger icon.

regards

Jeremy Ruston

unread,
Apr 18, 2014, 1:14:08 PM4/18/14
to Matabele, TiddlyWiki
Hi Matabele

The nested transclusions work in normal mode (although the transclusions collapse if I open another tiddler - thus changing the current tiddler) -- and also collapse when I press the hamburger icon.

This sounds very strange. Could you kindly share an example I can investigate? You're welcome to email it to me directly,

Best wishes

Jeremy


Reply all
Reply to author
Forward
0 new messages