Discussion:
[tw] Using TW after 5 year gap from TW2
AlanBCohen
2017-08-05 23:48:11 UTC
Permalink
Before I became disabled, I was a heavy user of some TW2 plugins; especially ForEachTiddler. For example, I created a tiddler with a name like 'journal'. The contents were a FeT that would list all the other tiddlers with the tag 'journal' with various sort and formatting. Another use was tagging journals with a progectid. In separate tiddler named the specific projectid, FeT was used to create a list of related journals (later expanded to list all the tiddler.texts as a printable diary for the projectid).
I have not been able to find a TW5 equivalent for this functionality. Can someone point me to how to accomplish this.
Once past this, there will probably be more questions.
Alan
--
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 ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/1537b1ff-eb6c-4d09-9e05-de5ba78db38c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Eric Shulman
2017-08-06 02:33:30 UTC
Permalink
Post by AlanBCohen
Before I became disabled, I was a heavy user of some TW2 plugins;
especially ForEachTiddler.
The TW5 native syntax that is most like ForEachTiddler is the <$list>
widget (http://tiddlywiki.com/#ListWidget). This widget takes a "filter
expression" as a parameter. The *contents* inside the <$list>...</$list>
widget block are then rendered "for each tiddler" that matches the
specified filter. By default the <$list> widget automatically sets the
value of <<currentTiddler>>, so that any field references within the
<$list>...</$list> widget block are relative each matched title. You can
use any combination of HTML and TW WikiText to format the output within the
widget block.
Post by AlanBCohen
For example, I created a tiddler with a name like 'journal'. The contents
were a FeT that would list all the other tiddlers with the tag 'journal'
with various sort and formatting.
Something like this:
(select all tiddlers with tag="journal" and sort by modification date,
newest to oldest)

<$list filter="[tag[journal]!sort[modified]]">
<li>
<$link><<currentTiddler>></$link>
</li>
</$list>

Another use was tagging journals with a progectid. In separate tiddler
Post by AlanBCohen
named the specific projectid, FeT was used to create a list of related
journals (later expanded to list all the tiddler.texts as a printable diary
for the projectid).
Something like this:
<$list filter="[tag<currentTiddler>!sort[modified]]">
<li>
<$link><<currentTiddler>></$link>
(<$view field="modified" format="date" template="MMM DDth, YYYY
0hh:0mm:0ss" />)
<blockquote><$transclude mode="block"/></blockquote>
</li>
</$list>

Note that in the above example, the value of <currentTiddler> in the
*filter* is DIFFERENT from the value of <<currentTiddler>> in the enclosed
*content*. Specifically, the filter syntax refers to the title of the
tiddler in which the <$list> widget occurs and is used with the "tag"
filter operator to select tiddlers tag with the current tiddler's title,
while the content syntax refers to the title of each tiddler that is
*matched* by the enclosing <$list> widget.

Also note: the filter syntax uses SINGLE brackets to delimit references,
while the content syntax uses DOUBLED brackets.

enjoy,

-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals
--
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 ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/175ba310-e068-4c2d-b6df-bb7531217db4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
AlanBCohen
2017-08-06 19:10:35 UTC
Permalink
Eric, Thanks for the help.
I've gotten farther.
This is what I have now:
''Tiddlers with the tag 'Journal', sorted by modified. Tiddler.text displayed on same line.''
<$list filter="[tag[Journal]sort[modified]]">
<section>
<ul>
<$link><<currentTiddler>></$link><<currentTag>> <$transclude>
</ul>
</section>
</$list>

Unfortunately <<currentTag>> is not returning any string. I also want to display each line with "|" with leading/ending "|" like the TW2 tables. A matching heading for the table would be nice. I've been reading HTML documentation unsuccessfully.
What I'd like to achieve would look like

| Title | Tags | Text |
| 2017.08.08 | Journal projectid | Bla. |

(With the heading line boldest or otherwise set apart.)
Alan
--
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 ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/74baac57-f70b-402c-9b5b-c1bb3f8f596a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
AlanBCohen
2017-08-06 20:00:51 UTC
Permalink
Eric,
Found some more HTML docs on tables. This is closer to what I want, but the currentTiddler and currentTags in the table aren't displaying.

''Tiddlers with the tag 'Journal', sorted by modified. Tiddler.text displayed on same line.''
<table>
<tr>
<th>Title </th>
<th>Tags </th>
<th>Text </th>
</tr>
<$list filter="[tag[Journal]sort[modified]]">
<tr>
<td><<link><<currentTiddler>></td>
<td><<tiddlerTag>></td>
<rd><$transclude></td>
</tr>
</$list>
</table>

I think the remaining problems are with the referencing the current line's Tiddler fields. The old TW2 fields were referenced as tiddler.title, tiddler.tags, tiddler.text. What are the equivalent field names and syntax?
--
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 ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/1447496b-2308-48a1-a89f-21728c149a3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Eric Shulman
2017-08-06 20:25:20 UTC
Permalink
Post by AlanBCohen
Eric,
Found some more HTML docs on tables. This is closer to what I want, but
the currentTiddler and currentTags in the table aren't displaying.
''Tiddlers with the tag 'Journal', sorted by modified. Tiddler.text
displayed on same line.''
<table>
<tr>
<th>Title </th>
<th>Tags </th>
<th>Text </th>
</tr>
<$list filter="[tag[Journal]sort[modified]]">
<tr>
<td><<link><<currentTiddler>></td>
<td><<tiddlerTag>></td>
<rd><$transclude></td>
</tr>
</$list>
</table>
I think the remaining problems are with the referencing the current line's
Tiddler fields. The old TW2 fields were referenced as tiddler.title,
tiddler.tags, tiddler.text. What are the equivalent field names and syntax?
1) Be careful with your syntax.
* TW widgets have this form: <$foo>...</$foo> (i.e., matching <$...> and
</$...>
* all widget names start with $
* only 1 set of brackets (i.e., <$foo>.... NOT <<$foo>>)
* handling of the content within the widget depends on the type of widget
* if the widget does not have any content, you can use an abbreviated
form: <$foo /> (note the trailing "/")

2) Within the <$list>...</$list> widget, all content is relative to the
<<currentTiddler>> value. You can refer to any field within the tiddler
using the <$view> widget. To display the tags for the currentTiddler, use
<$view field="tags"> no tags </$view>
* the content within the <$view>...</$view> is fallback text if the
specified field is missing or empty.
* if you don't want/need fallback content, you can use the abbreviated
form: <$view field="tags" />

3) Just like the <$view> widget, content within the
<$transclude>...</$transclude> widget is used as a fallback if the
tiddler/field does not exist. If no tiddler is specified, the
currentTiddler value is used by default. If no field is specified, the
"text" field is used by default. Thus,
<$transclude tiddler=<<currentTiddler>> field="text"> no text
</$transclude>
will display the text from the currentTiddler, or "no text" if the tiddler
or field does not exist.
* In the above example, you can omit the "tiddler" and "field" params
(since they specify the defaults), and just write: <$transclude> no text
</$transclude>
* If you don't want/need fallback content, you can use the abbreviated
form: <$transclude /> (again, note the trailing "/")

Here's your code, cleaned up a bit:
<table>
<tr>
<th>Title </th>
<th>Tags </th>
<th>Text </th>
</tr>
<$list filter="[tag[Journal]sort[modified]]">
<tr>
<td><$link><<currentTiddler>></$link></td>
<td><$view field="tags"> no tags </$view></td>
<td><$transclude /></td>
</tr>
</$list>
</table>

let me know how it goes...

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals
--
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 ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/04fcfad0-df0e-480d-8ad5-60a7eec7e490%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Eric Shulman
2017-08-06 22:10:12 UTC
Permalink
errata:

To display the tiddler content properly, add the mode="block" parameter to
the <$transclude> widget.... otherwise, the content will all become
'inline' and will flow onto lines without regard to paragraph/line breaks,
tables, bullet lists, etc.

<td><$transclude mode="block"/></td>

-e
--
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 ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/1711ba1b-2bde-407d-870e-8f4eb47290c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
AlanBCohen
2017-08-06 22:59:10 UTC
Permalink
Thank you again, Eric.
--
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 ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a0db2299-f132-45de-bfd7-bd9705824053%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
AlanBCohen
2017-08-06 23:46:59 UTC
Permalink
I used tour postings.
This is the final form.

List tiddler title, tags, and text in a table where tags include 'Journal', sorted by the modified daterime stamp.
<table>
<tr>
<th>Title </th>
<th>Tags </th>
<th>Text </th>
</tr>
<$list filter="[tag[Journal]sort[modified]]">
<tr>
<td><$link><<currentTiddler>></$link></td>
<td><$view field="tags"> no tags </$view>
</td>
<td><$view field="text"> </$view></td>
</tr>
</$list>
</table>

I consider this effort to have been a success.
Alan
--
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 ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/2c7f4079-6096-4ff7-b778-d4fa26a4fa35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...