Discussion:
[tw] How to add buttons if tiddler has a tag
Joe Armstrong
2018-02-21 17:24:33 UTC
Permalink
I want to make a triage system in TW5 - tasks are tagged 'now' 'later' and
'done'

My simple minded approach is as follows:

1. A tiddler can be tagged 'now' 'later' or 'done'
2. if a tiddler has the tag 'now' its background should be red and it
should have two buttons 'Move to Later' and 'Move to Done'
3. if I press 'Move to Later' the tag 'now' should be removed and a
'later' tag should be added. If I press 'Move to done' the 'now' tag should
be removed and a 'done' tag should be added.
4. Similar rules for treatment of the 'later' and 'done' tags.

How should I proceed?

Cheers

/Joe
--
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/7ba3db51-519c-46f4-86f7-1141f2fe3e3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Matthew Lauber
2018-02-21 17:43:32 UTC
Permalink
*Background color by tag*:
See https://tiddlywiki.com/#How%20to%20apply%20custom%20styles%20by%20tag

*Buttons on tagged tiddlers*. You're going to want to use a ViewTemplate.
A ViewTemplate is a tiddler tagged with $:/tags/ViewTemplate. It gets used
as a template for every tiddler in the story river, so you probably want to
start it with something like
<$list filter="[is[current]tag[Now]]">
...button code goes here...
</$list>

*Buttons that add and remove tags*. You're probably going to want to use
action widgets. Something along the line of
<$button>
<$action-sendmessage $message="tm-add-tag" $param="Later" />
<$action-sendmessage $message="tm-remove-tag" $param="Now" />
Move to Later
</$button>
Refer to https://tiddlywiki.com/#ActionSendMessageWidget
and https://tiddlywiki.com/#Messages for more info about that.
Post by Joe Armstrong
I want to make a triage system in TW5 - tasks are tagged 'now' 'later' and
'done'
1. A tiddler can be tagged 'now' 'later' or 'done'
2. if a tiddler has the tag 'now' its background should be red and it
should have two buttons 'Move to Later' and 'Move to Done'
3. if I press 'Move to Later' the tag 'now' should be removed and a
'later' tag should be added. If I press 'Move to done' the 'now' tag should
be removed and a 'done' tag should be added.
4. Similar rules for treatment of the 'later' and 'done' tags.
How should I proceed?
Cheers
/Joe
--
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/58db707f-82ce-405e-bdb7-c2c32f649634%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Joe Armstrong
2018-02-21 19:37:17 UTC
Permalink
*Background color by tag*: See
https://tiddlywiki.com/#How%20to%20apply%20custom%20styles%20by%20tag
*Buttons on tagged tiddlers*. You're going to want to use a
ViewTemplate. A ViewTemplate is a tiddler tagged with
$:/tags/ViewTemplate. It gets used as a template for every tiddler in the
story river, so you probably want to start it with something like
<$list filter="[is[current]tag[Now]]">
...button code goes here...
</$list>
*Buttons that add and remove tags*. You're probably going to want to use
action widgets. Something along the line of
<$button>
<$action-sendmessage $message="tm-add-tag" $param="Later" />
<$action-sendmessage $message="tm-remove-tag" $param="Now" />
Move to Later
</$button>
Refer to https://tiddlywiki.com/#ActionSendMessageWidget and
https://tiddlywiki.com/#Messages for more info about that.
Ok so now I have created exactly two tiddlers

FeedTheCats
has two tags 'Now' and '$:/tags/ViewTemplate'
and content
I must feed the cats

$:/tags/ViewTemplate
has the following content

<$list filter="[is[current]tag[Now]]">
<$button>
<$action-sendmessage $message="tm-add-tag" $param="Later" />
<$action-sendmessage $message="tm-remove-tag" $param="Now" />
Move to later
</$button>
</$list>

The result of this is that the tiddler FeedTheCats now says

I must feed the cats

I must feed the cats

ie the text is repeated - not exactly though, the lower line is in a
slightly smaller font than the
first line

So I'm tad confused.

Incidentally the initial value of ViewTemplate was empty - I'm not sure why

What can I try next?

/Joe
Post by Joe Armstrong
I want to make a triage system in TW5 - tasks are tagged 'now' 'later'
and 'done'
1. A tiddler can be tagged 'now' 'later' or 'done'
2. if a tiddler has the tag 'now' its background should be red and it
should have two buttons 'Move to Later' and 'Move to Done'
3. if I press 'Move to Later' the tag 'now' should be removed and a
'later' tag should be added. If I press 'Move to done' the 'now' tag should
be removed and a 'done' tag should be added.
4. Similar rules for treatment of the 'later' and 'done' tags.
How should I proceed?
Cheers
/Joe
--
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/c80a11dc-e879-4eac-8fa8-f7c59f214515%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Matthew Lauber
2018-02-21 20:06:05 UTC
Permalink
Ok, coming back to this and fleshing it out, there's a piece I missed, the
field mangler. you should be able to use the attached .tid file to
transition from now to later.

Matt
Post by Joe Armstrong
*Background color by tag*: See
https://tiddlywiki.com/#How%20to%20apply%20custom%20styles%20by%20tag
*Buttons on tagged tiddlers*. You're going to want to use a
ViewTemplate. A ViewTemplate is a tiddler tagged with
$:/tags/ViewTemplate. It gets used as a template for every tiddler in the
story river, so you probably want to start it with something like
<$list filter="[is[current]tag[Now]]">
...button code goes here...
</$list>
*Buttons that add and remove tags*. You're probably going to want to
use action widgets. Something along the line of
<$button>
<$action-sendmessage $message="tm-add-tag" $param="Later" />
<$action-sendmessage $message="tm-remove-tag" $param="Now" />
Move to Later
</$button>
Refer to https://tiddlywiki.com/#ActionSendMessageWidget and
https://tiddlywiki.com/#Messages for more info about that.
Ok so now I have created exactly two tiddlers
FeedTheCats
has two tags 'Now' and '$:/tags/ViewTemplate'
and content
I must feed the cats
$:/tags/ViewTemplate
has the following content
<$list filter="[is[current]tag[Now]]">
<$button>
<$action-sendmessage $message="tm-add-tag" $param="Later" />
<$action-sendmessage $message="tm-remove-tag" $param="Now" />
Move to later
</$button>
</$list>
The result of this is that the tiddler FeedTheCats now says
I must feed the cats
I must feed the cats
ie the text is repeated - not exactly though, the lower line is in a
slightly smaller font than the
first line
So I'm tad confused.
Incidentally the initial value of ViewTemplate was empty - I'm not sure why
What can I try next?
/Joe
Post by Joe Armstrong
I want to make a triage system in TW5 - tasks are tagged 'now' 'later'
and 'done'
1. A tiddler can be tagged 'now' 'later' or 'done'
2. if a tiddler has the tag 'now' its background should be red and
it should have two buttons 'Move to Later' and 'Move to Done'
3. if I press 'Move to Later' the tag 'now' should be removed and a
'later' tag should be added. If I press 'Move to done' the 'now' tag should
be removed and a 'done' tag should be added.
4. Similar rules for treatment of the 'later' and 'done' tags.
How should I proceed?
Cheers
/Joe
--
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/98523b80-ea45-4aba-8765-12755c27b1b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Surya' via TiddlyWiki
2018-02-21 20:14:23 UTC
Permalink
Ohhh, never forget or move feeding your fur-monsters AND making the cats
toilet to "later" ;-)))


Miauu, Surya
--
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/0712851a-16c1-4b46-adb4-a00e2c27a0a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
TonyM
2018-02-21 17:53:08 UTC
Permalink
Hi,

A quick pointer

See https://tiddlywiki.com/#How%20to%20apply%20custom%20styles%20by%20tag

For changing the look of tiddlers for each tag

Then search for cycletags there are solutions to help.

Regards Tony
--
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/596deded-a215-4bed-8630-3307a66dd857%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
BurningTreeC
2018-02-21 19:50:26 UTC
Permalink
Hi Joe,

all Tiddlers tagged with $:/tags/ViewTemplate get used AS A VIEWTEMPLATE

so the content of your newly tagged tiddler will also be shown on any other
tiddler when not in "edit-mode"

that's the purpose of the tag $:/tags/ViewTemplate

Simon
--
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/8e9dfa46-4e52-476c-a57a-2fb94c69ff92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Joe Armstrong
2018-02-21 20:01:26 UTC
Permalink
Goodness you're right I'd missed that -- now it says I have to feed the
cats on every single tiddler - not what I wanted.

So the rule

<$list filter="[is[current]tag[Now]]">

is applied to every tiddler - How do I say (In pseudo code)

if currentTiddler has tag 'Now' then
add a button at the top of the tiddler
and display the tiddler
else
display the tiddler
end

Cheers

/Joe
Post by BurningTreeC
Hi Joe,
all Tiddlers tagged with $:/tags/ViewTemplate get used AS A VIEWTEMPLATE
so the content of your newly tagged tiddler will also be shown on any
other tiddler when not in "edit-mode"
that's the purpose of the tag $:/tags/ViewTemplate
Simon
--
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/e9f20340-c7a7-47c0-926e-c38f8747df4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...