If you'll please not laugh too loudly, here's what I've been doing with 
mangletags.  It cycles through a list of tags, leaving other tags in 
place.  It works pretty well, except I don't know how to go back to the 
beginning of the list once the end has ben reached.  Any help would be 
gratefully accepted!

For this example, create a tiddler called Daylist, and give it a list field 
containing "Mon Tue Wed ..."
In your tiddler where you want to cycle the tags, add the tag Mon, and 
create a field "current" with the same value as the tag (Mon).  
Then either put the code inside that tiddler or use the {{||cycleTags}} 
option.  
Code:
\define nexttag(now)
[list[Daylist]after[$(now)$]] 
\end

\define swaptag(to, newtag, oldtag)
<$setfield set="$to$!!current" setTo="$newtag$">
<$mangletags find="$(oldtag)$" add="$newtag$" message="tw-set-field">
<$button message="tw-mangle-tags"> cycle </$button><br></$mangletags></
$setfield>
\end

\define prepare2()
<$macrocall $name="swaptag" to={{!!title}}  newtag=<<definenexttag>>/>
\end

<$set name="now" value={{!!current}} >
<$set name="oldtag" value=<<now>> >

<$list filter=<<nexttag>> variable="definenexttag" >

<$list filter="[all[current]]">
<$link>{{!!title}}</$link> <<prepare2>><br>
</$list>

</$list>

</$set>
</$set>

cmari



On Tuesday, July 1, 2014 7:41:31 AM UTC-7, Måns wrote:
>
> Hi Stephan
>
> Very nice solutions - both of them! Thank you very much :-)
> They both do what I need now and it doesn't matter that they use all of 
> the tagfield value..
> I guess I could change it to work on any other field if I want other tags 
> to the tiddlers..
>
> Of course I'm also wondering if it is possible to create yet another 
> generic tagcycler which will allow other tag values on a tiddler side by 
> side - and not overwrite them... eg. "task" + a cycle of tags like: 
> "urgent" or "[[on hold]]" or "done" etc..
>
> Thanks again - Your help is very much appreciated :-)
>
> Cheers Måns Mårtensson
>
>
> Den tirsdag den 1. juli 2014 12.10.51 UTC+2 skrev Stephan Hradek:
>>
>> A more generic approach. Create a tiddler "cycleTags"
>>
>> \define btn()
>> <$button set="$(transcluder)$!!tags" setTo={{!!title}}><$view field=
>> "title">clear</$view></$button>
>> \end
>> <$set name="transcluder" value={{!!title}}>
>> <$list filter="[[]] [is[current]list[!!tagcycle]] +[after{!!tags}] [[]] 
>> +[limit[1]]"><<btn>></$list>
>> <$set>
>>
>> Put this into your tiddler you want to rag:
>> {{!!title||cycleTags}}
>>
>> Or this if you want to tag another tiddler from somewhere:
>> {{My Tiddler to tag||cycleTags}}
>>
>> Add a field "tagcycle"to the tiddler to tag which contains the tags 
>> youwamnt in the sequence you want them ("A B C")
>>
>

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to