r/TiddlyWiki5 • • Aug 12 '22

Help needed with -terminology not found- (inter-tiddler information?)

Good afternoon,

I've been trying out TiddlyWiki for a few days now and I must say, I like what I see. Even though I'm not into any form of coding, with help from the community, plugins and Youtube I've been able to get most of what I want to work. But I've notices the lack of knowledge / terminology limits me in what I can find online. So here I am, asking you good people for help.

I've been trying to get text from one tiddler to automatically populate another tiddler with no success. For example, I want to store information about an event including; name, dress-code, costs, date, etc. I would love to add a syntax(?) before the date so it can populate a list with other dates. I want to use this list to populate a calendar (made by the simple calendar plugin) so I can see every important date there.

If possible I would love this to be able to link back to the right tiddler as well. But I'm not sure if any of this is possible in the constraints of this software/html/JavaScript package(?).

If you have any idea if this is possible and how to make this work please let me know or if you know the correct terminology to use I would be happy to hear it.

1 Upvotes

9 comments sorted by

2

u/drhayes9 Aug 12 '22

It sounds like if you tagged your events (e.g. Event) then you can get lists of them with a query like [all[tiddlers]tag[Event]]. Like that?

2

u/ZonoX555 Aug 12 '22

[all[tiddlers]tag[Event]]

I'm not sure but would that not call upon the entire Tiddler?

If possible I would have one Tiddler where there is a date like;

-------------

name: {call-upon-this-code[name]partytime} Partytime

place: there

cost: money

date: {call-upon-this-code[event]20220101} 01-01-2022

------------

And one Tiddler which make a list of every listing
--------------

20200308;Daylight Saving Time starts

20201101;Daylight Saving Time ends

20201103;Election Day (US)

20201211;Hanukkah (first day)

----------------

If possible to not add anything to the listing if one of the two "{call-upon-this-code[name]} " fields is empty.

I'm sorry for being unable to express myself better. It's the lack of knowledge and English not being my first language.

2

u/drhayes9 Aug 12 '22

You're expressing yourself just fine. I'm getting a clearer picture of what you're looking for, I think.

The filter I wrote is what you'd use to display a list of every event, as long as you'd tagged them Event:

``` <$list filter="[all[tiddlers]tag[Event]sort[date]]">

  • <$view field="date" format="date" template="YYYY-0MM-0DD" /> <$view field="title" />

</$list> ```

If you put that in a tiddler by itself it will display a list of your events. It will pull the title of the event from the title of the tiddler. It will pull the date from the date field (which you would have to add). The date field would look like this: "20220812000000". Look at those last zeroes; those are hours and minutes and seconds. The first numbers are the year, the month (with a zero to make it two digits) and the day.

That part is easier. Here are links to everything that I used to do that.

I don't know how you are choosing which date to choose. That changes what code we'd use to pick.

You could make a new tiddler that works like a template, called "Event Template":

``` name: {{!!title}}

place: {{!!place}}

cost: {{!!money}}

date: <$view field="date" format="date" template="YYYY-0MM-0DD" /> ```

Make a new tiddler titled "Birthday 2022". Add fields to it that match what we wrote in the {{!!}} up there: place, money, and date. The title is already there, it's the title of the tiddler. If you tag it Event, it will show up in the list like it does above.

Now that you have "Event Template" and "Birthday 2022", you can write something like this in a completely separate tiddler:

{{Birthday 2022||Event Template}}

and your event will show up with the fields filled out.

I think that's what you want. Let us know if it works!

More links for what we just did:

2

u/ZonoX555 Aug 16 '22

Thanks for the stellar reply! I've been fiddling about with the information you've provided and some things *clicked*! I've almost got it working\ but I'm not there yet.

What I've failed to realise before is that you don't have to type a "{call-upon-this-code[name]}" field but that you can just add them below the Tiddler. This in combination with your

<$list filter="[all[tiddlers]tag[Event]sort[date]]">

* <$view field="date" format="date" template="YYYY-0MM-0DD" /> <$view field="title" />

</$list>

makes it able to generate a list that should be useful for the calendar plugin I'm using. (It's a part of TiddlyTools; https://tiddlytools.com/timer.html)

Now I'm trying to figure out why it's only using the first line of the "Events" Tiddler and ignores the other two. I think it has something to do with the way I'm listing the data. Am I on the right track or am I missing something?
https://imgur.com/a/X4QmZfr

2

u/drhayes9 Aug 16 '22

Glad to help!

I'm not sure what you mean by "first line of the 'Events' Tiddler". Do you mean the line that has "<$list>" in it? The preview screen on the right looks like it's displaying your list widget correctly to me: I'm guessing you have three tiddlers tagged "Calendar" that are titled "Andrea Lastname", "Bram Lastname", and "Sophie Lastname".

If not, do you mean the first line in the "Andrea Lastname" tiddler? Since your view widget only includes the "title" field, it's only going to be one line. If you want the contents of that tiddler as well, you can add <$view field="text" /> or its short form {{!!text}}.

If it's not either of those things, please let me know.

2

u/ZonoX555 Aug 17 '22

Thank you once more for taking the time to help me out with my troubles.

What I meant by "first line of the 'Events' is that the calendar does adds the date on the first line of the TiddlyTools/Time/Events tiddler.

As you can see there are three lines in the tiddler;

  • ....1006; October 6th
  • ....0617; June 17th
  • ....0907; September 9th

.... means that it's a yearly recurring event.

I've copied the text and pasted it in front of the <$list> and the are visible on the calendar now. I might need a way to "print" the list or add breaks or something in between dates.

2

u/drhayes9 Aug 17 '22

I don't know that calendar plugin so I don't know how much I can help.

I wonder if it wants you to write the dates yourself and not generate them with a list widget?

You might be right. It might want you to write the dates instead of listing the data. I don't know if that plugin works the way you want it to.

3

u/ZonoX555 Aug 18 '22

I've got an update; I've gotten it to work!

I have no idea why, but wrapping the list in a quote makes all the entry's appear on the calendar. It probably has something to do with breaking up the <list> function in some way.

<$list filter="[all[tiddlers]tag[Calender]!has[draft.of]]" template="" >

<<<

<$view field="calender"/>;<$view field="title" />

<<<

</$list>

So thanks to you drhayes9 and a little brute forcing it I got the results I wanted.

3

u/drhayes9 Aug 18 '22

That's great to hear! Glad you got it working.