Re: forEachTiddler with partTiddler

123 views
Skip to first unread message

whatever

unread,
Jul 4, 2012, 1:09:56 PM7/4/12
to TiddlyWiki
Hi!

in the write parameter use:
'"<<tiddler "+tiddler.name+"/Summary>\>"'

w

On 4 jul., 16:54, Shango <shango3...@gmail.com> wrote:
> How can I use forEachTiddler to show specifically named parts?  I want to
> display the tidder name and contents of a specifically named part of a
> tiddler if it exists.  For example, if I have a part named "Summary" in
> several different tiddlers, I want to use forEachTiddler where the
> part="Summary" and display that tiddler title and the contents of the
> part.  I haven't found any way to do this.  Thanks.

Shango

unread,
Jul 4, 2012, 1:46:04 PM7/4/12
to tiddl...@googlegroups.com
Ah Ha!!!  I knew the method but I didn't know the correct syntax.  The ">\>" is what I needed.  Is that a quirk of html syntax?  I don't understand the "\>"  Why can't it just be the closing ">>"? 

  (Also, should be tiddler.title not tiddler.name). 

Thanks!

TonyM

unread,
Jul 4, 2012, 9:16:17 PM7/4/12
to tiddl...@googlegroups.com
Why can't it just be the closing ">>" ?

Because it would prematurely close the matching << on the ForEachTiddler macro itself ! in the calling tiddler !

TonyM

Shango

unread,
Jul 5, 2012, 9:10:17 AM7/5/12
to tiddl...@googlegroups.com
Oh ok.  I thought since it is enclosed in quotes as a string, it would not be confused. 

I have another question.  How do I prevent tiddlers that do not have any "Summary" part from showing at all in the output?  I just need a way to test for a null value of the partTiddler in the where clause.  I'm not sure how to do that. 

Thanks. 

twgrp

unread,
Jul 5, 2012, 9:26:46 AM7/5/12
to TiddlyWiki
I recall recommendations *against* using parts and instead use either
slices or, hm what's it called, headings?
Not quite sure why, though... ?

Examples of this are:

|Here|is a slice value|

!And here
is a heading value


You pull out the values via:

tiddlername::Here

and

[[tiddlername##And here]]


<:-)

whatever

unread,
Jul 5, 2012, 9:37:41 AM7/5/12
to TiddlyWiki
@twgrp: The beauty of parts is that you can use them within the text.
For example:
Blah blah blah means <part def1>whatever it means</part> blah blah.

@Shango: yeah, it's tiddler.title, not name. I was tired when I wrote
that:D

w

Shango

unread,
Jul 6, 2012, 3:07:06 PM7/6/12
to tiddl...@googlegroups.com

whatever

unread,
Jul 6, 2012, 3:25:51 PM7/6/12
to TiddlyWiki
Doesn't it automatically get excluded?

Otherwise do this in the where part:
'tiddler.tags.contains("YourTag") && tiddler.text.contains("part
Summary)'

w

Shango

unread,
Jul 7, 2012, 1:29:45 AM7/7/12
to tiddl...@googlegroups.com
If all I was displaying was the tiddlerPart, then I think blank ones would skip.  But since I'm displaying tiddler.title also, then all the tiddlers in the forEachTiddler will display.  I was hoping I wouldn't have to bother with using tags for checking but that may be the only way it will work :(

Thanks

Shango

unread,
Jul 7, 2012, 1:58:54 AM7/7/12
to tiddl...@googlegroups.com
Hey, actually I don't need to check for a tag value.  && tiddler.text.contains("part Summary") is a good enough check.  Thanks!!

Let me explain what I wanted to do.  I have a journal with tiddlers entered as dates.  They are in the format YYYY-MM-DD so I can easily query a range of dates (where tiddler.title >= "2009-12-21" && tiddler.title <= "2010-04-05").  I have a "Timeline" tiddler that has a series of forEachTiddler statements with date ranges looking for the partTiddler "Timeline" entries.  If I want to put something on the Timeline I just put a <part Timeline> in the journal tiddler.  Now it works!!
Reply all
Reply to author
Forward
0 new messages