TW5 Transclude Full Tiddler problem

228 views
Skip to first unread message

Michael Wiktowy

unread,
Apr 17, 2014, 12:29:16 AM4/17/14
to tiddl...@googlegroups.com
Greetings all,

I think TiddlyWiki is very cool and I am trying to adapt it my own needs but I am running into a snag and was wondering if I am missing something obvious due the gaping holes in my html coding knowledge/understanding or something else going on that is fixable.

I am trying to build a set of tagged Tiddlers and then use a filter to display the full tiddlers one after the other with minimal additional formatting applied to each Tiddler that matched the filter. I looked at the TW5 Magic site and, using http://tw5magick.tiddlyspot.com/#Transcluding%20a%20full%20Tiddler as my guide, developed my current technique of:

1) Putting this line where I want the tagged items to be transcluded in expanded form (not just a list of the titles):
{{{[tag[some_random_tag]] ||expand}}}

2) Having an "expand" tiddler to be used as a TemplateTiddler consisting of:

#<$view field="text" /><br>

in order to make the result into a numbered list of my set of matched tiddlers with some space between each entry.

If I don't have the # (or * or whatever) in front and the tiddler matched by the filter is just plain text with no wiki markup, it works as I would like. However, if the tiddler has any markup, like hidden text or table formatting, the result is displayed as plain text with all the tiddler markup visible and not interpreted. If I subsequently cut and paste that resulting block of plain text into another tiddler, it shows up *exactly* how I would love for it to show up transcluded in the first place.

Is there a way to force the text returned by the {{{}}} transclusion to be interpreted as wikitext and not just inserted as plain text?

I have tried adding the various "format=" variations to my TemplateTiddler only to either have the html code (instead of wikicode) show up as plain text or my whole TiddlyWiki crash with recursion errors and become forever unusable since "expand" could not be deleted without crashing TiddlyWiki.

I would appreciate any pointers or advice or statements that I am abusing TiddlyWiki for purposes for which it was not intended.

Thank you,
/Mike

Stephan Hradek

unread,
Apr 17, 2014, 1:42:24 AM4/17/14
to tiddl...@googlegroups.com
Go for HTML…

<ol>{{{[tag[some_random_tag]] ||expand}}}</ol>

and your expand:

<li><$view field="text" /></li>


Jeremy Ruston

unread,
Apr 17, 2014, 8:27:24 AM4/17/14
to TiddlyWiki
Hi Michael

However, if the tiddler has any markup, like hidden text or table formatting, the result is displayed as plain text with all the tiddler markup visible and not interpreted. If I subsequently cut and paste that resulting block of plain text into another tiddler, it shows up *exactly* how I would love for it to show up transcluded in the first place.

The first issue is that TiddlyWiki has to distinguish between parsing in block mode (where it recognises block mode formatting like headings and tables) and inline mode (where it recognises character formatting and other inline elements). Here, your template tiddler is being parsed in inline mode, and so isn't recognising the #, which is block mode syntax.

We can work around that, but the second issue would then arise: the numbered list within each transclusion would be parsed separately.

The solution is, as Stephan suggests, to use explicit HTML tags to give you precise control.

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

Michael Wiktowy

unread,
Apr 17, 2014, 10:17:44 AM4/17/14
to tiddl...@googlegroups.com
Thank you Stephan and Jeremy for the suggestion. It gets me thinking of other solutions but it is only half-way towards what I would like to do ... which may be impossible.

Let me be clearer:
Given a bunch of Tiddlers generated by users unfamiliar with html but provided with some TiddlyWiki marked-up examples to work from.

Some may be tables like this:

     |''A'' | ''B''|
     |''C''| ''D''|
     |A bunch of plain text|<|

Others may be formatted like this:

     <!-- With some hidden text that I don't want to see in the transclusion-built list -->
     [[some links]] and ''some other formatting''

and destined to be bullet points in a list.

I would like to group them together in arbitrary ways based on matching a filter and some sorting.

The solution that you gave me allows me to put on the "window-dressing" ... be it a list (like I would want to do with the second example) or just simple concatenation (like I want to do with the tables). I may have to use different "expanders" based on when I want a list or concatenation at the end ... that is OK since that is not something I expect the end user to have to mess with.

However, using your suggestion, the initial Tiddlers are showing up with all the markup not interpreted in the final transcluded compilation of Tiddlers ... including the basic html <!-- comment --> tags that I am using to give users some instruction that won't show up in the final Tiddler.

They are showing up like:

1. <!-- With some hidden text from Tiddler 1 that I don't want to see in the transclution-built list -->
[[some links in 1]] and ''some other formatting''

2. <!-- With some hidden text from Tiddler 2 that I don't want to see in the transclution-built list -->
[[some links in 2]] and ''some other formatting''

3. <!-- With some hidden text from Tiddler 3 that I don't want to see in the transclution-built list -->
[[some links in 3]] and ''some other formatting''

I would like:

1. <some links in 1> and *some other formatting*
2. <some links in 2> and *some other formatting*
3. <some links in 3> and *some other formatting*

where <> are hyperlinks and ** is bolding in this case.

Is this something impossible since a single Tiddler can only get interpreted/translated once?

Thanks for your help.
/Mike



--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/RLp-xcmUrE4/unsubscribe.
To unsubscribe from this group and all its topics, 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.



--
Michael Wiktowy mwik...@gmail.com

Jeremy Ruston

unread,
Apr 17, 2014, 10:20:12 AM4/17/14
to TiddlyWiki
Hi Michael

Try replacing <$view field="text" /> with <$transclude/>

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

Michael Wiktowy

unread,
Apr 17, 2014, 10:38:32 AM4/17/14
to tiddl...@googlegroups.com
<slaps forehead>

I thought that I had tried that initially but I guess not or maybe abandoned it due to not knowing the html tip ... anyway ... combining those two suggestions (<$transclude/> and html in the template rather than wikitext) gets me what I wanted.

Thank you all so much for the guidance and for a nifty tool!
/Mike


On Thu, Apr 17, 2014 at 10:20 AM, Jeremy Ruston <jeremy...@gmail.com> wrote:
Hi Michael

Try replacing <$view field="text" /> with <$transclude/>

Best wishes

Jeremy


--
Michael Wiktowy mwik...@gmail.com

Michael Wiktowy

unread,
Apr 17, 2014, 11:22:06 AM4/17/14
to tiddl...@googlegroups.com
Oops ... I spoke too soon. <$transclude/> works with my list of formatted text case but the first case with concatenated tables, it doesn't. The case where it works it the more important one. The table case would be a nicety. I will play with a combination of <table> <td> <tr> tags to see if I can coerce it to work the same way as lists.

Back to the drawing board.

/Mike

--
Michael Wiktowy mwik...@gmail.com

Jeremy Ruston

unread,
Apr 17, 2014, 11:24:05 AM4/17/14
to TiddlyWiki
Hi Michael

<$transclude/> works with my list of formatted text case but the first case with concatenated tables, it doesn't. 

That sounds like the inline/block issue I mentioned above. Try:

<$transclude mode="block"/>

See:


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.

Michael Wiktowy

unread,
Apr 17, 2014, 11:51:37 AM4/17/14
to tiddl...@googlegroups.com
Hi Jeremy,

That, indeed, did the trick! It is all coming together in my head ... slowly. Things work great now and compilation tiddlers are being populated automagically when others are tagged ... wonderful.

Thank you kindly.

For the benefit of anyone else trying to do what I am doing, for the record:

To make a concatenated list of transcluded tables:
1) make a tiddler named "expandblock" containing <$transclude mode="block"/>
2) put {{{[tag[some_tag]] ||expandblock}}} where you want a blob of expanded tables to go matching "some_tag"

To make a list of transcluded items:
1) make a tiddler named "expandlist" containing <li><$transclude/></li>
2) put <ul>{{{[tag[some_tag]] ||expandlist}}}</ul> where you want an unordered list or
<ol>{{{[tag[some_tag]] ||expandlist}}}</ol> where you want an ordered list of tiddlers matching "some_tag" to go.

/Mike


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/RLp-xcmUrE4/unsubscribe.
To unsubscribe from this group and all its topics, 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.



--
Michael Wiktowy mwik...@gmail.com
Reply all
Reply to author
Forward
0 new messages