I didn't put them all in one tiddler since I want to use pieces of it
elsewhere; on tag pages, I want it automatically added as a suffix after
the body of the tiddler. But on other tiddlers, I may want to talk about
some different tags and include a list about them (e.g. "RPG characters
have skills and feats. <$macrocall $name="listTagged" tagName="skills" />
<$macrocall $name="listTagged" tagName="feats" /> Pick two skills and one
feat to start.").
On Wednesday, March 27, 2019 at 11:24:47 PM UTC-5, Mohammad wrote:
>
> Why dont put all of them in one tiddler?
>
> On Monday, March 25, 2019 at 5:55:24 PM UTC+4:30, MidnightLightning wrote:
>>
>> Thanks, that got me on the right track for an answer!
>>
>> Using the [tag<currentTiddler>limit[1]]] filter as an outer $list works,
>> though it resets the currentTiddler variable to the first tiddler that's
>> tagged with the original tiddler. So, I ended up doing this:
>>
>> A global Macro (in case I want to use it elsewhere):
>>
>> \define listTagged(tagName)
>> <$set name="t" value=<<__tagName__>>><$list filter="[title<t>]">
>> <$count filter="[tag<t>]" /> Pages tagged with <$macrocall $name=
>> "tag-pill-body" tag=<<currentTiddler>> icon={{!!icon}} colour={{!!color}}
>> palette={{$:/palette}} element-tag="""$button"""
>> element-attributes="""tag='span'"""/>:
>> <ul><$list filter="[tag<t>]">
>> <li><$link><$view field="title" /></$link></li>
>> </$list></ul>
>> </$list>
>> </$set>
>> \end
>>
>>
>> And then a ViewTemplate to use it:
>>
>> <$set name="t" value=<<currentTiddler>>>
>> <$list filter="[tag<currentTiddler>limit[1]]">
>> <hr />
>> <$macrocall $name="listTagged" tagName=<<t>> />
>> </$list>
>> </$set>
>>
>>
>> The trick is I used a $set call to save the first currentTiddler value
>> to a separate variable (t) for use later in the logic.
>>
>>
>>
>> On Friday, March 22, 2019 at 9:50:09 PM UTC-5, TonyM wrote:
>>>
>>> MidnightLightning
>>>
>>> Partial answer for you, but FYI the standard google groups is
>>> appropriate for this kind of question and you may get a faster response
>>> there.
>>>
>>> Rather than count the tags $list <https://tiddlywiki.com/#ListWidget>
>>> the tags with limit[1] and the content of the list widget will only show if
>>> there are more than one tag.
>>>
>>> [tag<currentTiddler>limit[1]]
>>>
>>> You could use emptyMessage if you wanted.
>>>
>>> In other circumstances (except variables at present) you can use the
>>> View widget, as The content of the <$view> widget is displayed if the
>>> field or property is missing or empty.
>>>
>>> Regards
>>> Tony
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywikidev/39946865-e528-4f0a-98e8-1505ebedd6d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.