This is a macro to clicked and manually create a title for state tiddler.

\define create_id_from_timedata(prefix) $prefix$-<<now [UTC]
YYYY0MM0DD0hh0mm0ssXXX>>


\define uniqueId(prefix:id)
<$wikify name=id text=<<create_id_from_timedata """$prefix$""">>  >
<$button class="tc-btn-invisible" message="tm-copy-to-clipboard" param=<<id
>> >
 {{$:/core/images/copy-clipboard}} create unique id
</$button>
</$wikify>
\end


call it like

<<uniqueId mystate>>

The most important drawback is: it is manual!

What do you think?


--Mohammad


On Monday, February 10, 2020 at 3:44:40 PM UTC+3:30, Mohammad wrote:
>
> Refereeing to recent discussion on The Good and Bad of qualify: 
> https://groups.google.com/d/msg/tiddlywiki/51XMzmLGxfQ/PLkfWWthBAAJ
>
> We know many cases in creating User Interfaces (UI) needs some state 
> tiddlers.
>
> I got used to call  qualify for such cases, but with the recent discussion 
> it seems qualify is designed for purposes one like to keep some states 
> permanently and irrespective of current tiddler situation.
>
> Mat proposed a slugify operator 
> <https://github.com/Jermolene/TiddlyWiki5/issues/3379#issuecomment-505042751>.
>  
> Also the Mario unique ID plugin is a potential tool here
>
>
> My question is:
>
> Is there any other ways to create unique stateTiddler? I dont mean do this 
> manually?
>
>
> There are situation, one needs permanent state tiddler to keep data. For 
> example in Shiraz dynamic table I uses state tiddler to keep footer data or 
> row styles.
> These are not temporary data and it is tedious to define unique state 
> tiddler for every table!
> The current mechanism I use is qualify macro which is not good for all 
> scenario.
>
>
> --Mohammad
>
>
> p.s:
>  One KISS solution is to use a helper function which calls now macro 
> with [UTC]YYYY0MM0DD0hh0mm0ssXXX format to create a unique title for the 
> required state tiddler.
>
>

-- 
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/4e04d175-0bbc-4c28-88f1-d749735a69ac%40googlegroups.com.

Reply via email to