Hey Tony,
Thanks for the tips, they're really appreciated. I found an easier way to
do what I wanted, but without having to change the currentTiddler.
Unfortunately, I'm having a problem with the syntax in the list filter
that's driving me a bit crazy. In the list filter, if I put the actual
field values into the tag filter, it works perfectly. But if I use text
references for the fields, nothing is returned. I've tried every syntax
combination I can think of, and nothing seems to work. I'm using a $button
for the list items now and the list is always empty. But when I was using
a $checkbox for the list items, then the filter seemed to work fine.
Here's the list filter with the direct field value substitutions - and it
works fine:
<$list filter="[!has[draft.of]tag[Brief]*tag[14-33296]!tag[14-00000]*
sort[title]]">
<div>
<$button><$action-listops $tags="[{!!super-opfac}]
-[{!!parent-opfac}]"/>Promote</$button>
<$link to={{!!title}}><$view field="title"/></$link>
</div>
</$list>
But when I try to use text references for the field values, it doesn't work:
<$list filter="[!has[draft.of]tag[Brief]
*tag{!!parent-opfac}!tag{!!super-opfac}*sort[title]]">
<div>
<$button><$action-listops $tags="[{!!super-opfac}]
-[{!!parent-opfac}]"/>Promote</$button>
<$link to={{!!title}}><$view field="title"/></$link>
</div>
</$list>
Forgive my naivete with Tiddlywiki, but can you help me understand what I'm
doing wrong?
Thanks in advance,
Scott
On Monday, June 22, 2020 at 12:09:16 AM UTC-4, TW Tones wrote:
>
> Scott,
>
> Quick tip, in your lists above the `<<currentTiddler>>` changes according
> to the list filter, that is why {{!!title}} refers to the tiddler in the
> list (result of the filter). However you could always use another
> variable=other-tiddler in the list statement to keep referring to the
> original tiddler, but then you will have to use the <<other-tiddler>>
> variable say in the viewWidget to access the other fields in
> <<other-tiddler>>.
>
> At anyplace in your wikitext you can set the current tiddler to another,
> using the tiddler widget, and this can be driven by a variable
> <$tiddler tiddler=<<other-title>> >
>
> In here <<currentTiddler>> = <<other-title>> and {{!!title}} refers to
> the title in <<other-title>>
>
> </$list>
>
> Also if you know how to access a tiddler and its field with a filter you
> can wrap that filter in triple Curly Braces
> eg
> {{{[<other-tiddler>get<fieldname>]}}}
>
> Ask more questions once you explore these tips.
>
> Tony
>
>
> On Monday, June 22, 2020 at 1:16:34 PM UTC+10, Scott Masterson wrote:
>>
>> Hello All,
>>
>> This is my first post here, so please forgive my naiveite and beginner
>> status. BLUF: I'm trying to create a prototype for a notification system
>> for a relatively complex military organization, and I'm trying to figure
>> out how to reference the fields of one Tiddler, while transcluding another
>> Tiddler field into a list in that Tiddler?
>>
>> Now here's the long-winded version. Each *Unit Tiddler* in the
>> organization has a field with that unit's ID, called the *unit-opfac*,
>> as well as a field for its parent unit, called the *parent-opfac*. A *Brief
>> Tiddler* can be created (from a button generating a Tiddler based on the
>> Brief Template) at any unit level and will be tagged with *[Brief]* as
>> well as its *unit-opfac* and its *parent-opfac*. I want to use the
>> *checkbox
>> *widget to allow each brief to be promoted up the organizational chain
>> by being tagged with the unit's *parent-opfac*. This will allow someone
>> at each unit level to promote a brief up the chain at will. I wrote the
>> below code and thought I was doing great - until I realized that the
>> *parent-opfac* and *unit-opfac* fields that I was transcluding were from
>> the *Brief Tiddler*, and not the *Unit Tiddler*. So, how can I
>> filter/modify tags that are based on fields in the Unit Tiddler, rather
>> than those in the Brief Tiddler? I think the logic I've written will do
>> what I want (see below), IF I can figure out how to reference the correct
>> fields. Thanks in advance!
>>
>> Scott
>>
>>
>> *Unit Tiddler*
>>
>> *Tags:* Title of Parent Unit
>>
>> *Tiddler Text:*
>>
>> ! Promoted Briefs
>> <$list filter=
>> "[!has[draft.of]tag[Brief]tag[{!!parent-opfac}]tag[{unit-opfac}]sort[created]]"
>> >
>> <div>
>> <$checkbox tag={{!!parent-opfac}}> __<$link to={{!!title}}><$view
>> field="title"/></$link>__</$checkbox>
>> </div>
>> </$list>
>>
>> ! Incoming Briefs
>> <$list
>> filter="[tag:[Brief]tag:{!!unit-opfac}!tag[{!!parent-opfac}]sort[created]]">
>> <div>
>> <$checkbox tag={{!!parent-opfac}}> <$link to={{!!title}}><$view
>> field="title"/></$link></$checkbox>
>> </div>
>> </$list>
>>
>> *Fields:*
>> parent-opfac: 14-00000
>> unit-opfac: 14-33296
>>
>>
>> *Brief Tiddler*
>>
>> *Tags:* Every unit-opfac the Brief Tiddler is promoted to.
>>
>> *Tiddler Text: *Some briefing text...
>>
>> *Fields:*
>> parent-opfac: 14-33296
>> unit-opfac: 14-33296-P
>>
>>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/023e77bf-c8df-45f7-9e53-55bb67713822o%40googlegroups.com.