Best wishes
Mohammad

On Mon, Feb 10, 2020 at 7:07 PM PMario <[email protected]> wrote:

> On Monday, February 10, 2020 at 3:07:06 PM UTC+1, Mohammad wrote:
>>
>>
>> On Monday, February 10, 2020 at 5:12:04 PM UTC+3:30, PMario wrote:
>> .....
>>
>  I know it's not a real solution for your request but anyway:
>>>
>>> I did create a PR at github
>>> <https://github.com/Jermolene/TiddlyWiki5/pull/4454>, that allows the
>>> qualify-macro to use a isUnique parameter. So you can use
>>> <<qualify "my-unique-title" isUnique:"yes">> .. So the macro doesn't
>>> add -123456 string. It returns the input state text.
>>>
>>>
>>
>> Are these unique permanent state or will be changed from session to
>> another session or different position of host tiddler in the widget tree?
>>
>
> It basically is a "title-pass-through". So the user has to make the title
> unique. ... The advantage is, that there is a new parameter isUnique
>
> Eg: the core tabs macro uses the <<qualify "$state$">> in the macro code.
> .. The problem now is, that as a developer I need to change the core tabs
> macro if I don't want the default behaviour of the qualify macro. ...
>
> If you have a look at the PR, I also changed the core tabs macro like so: 
> <<qualify
> "$state$" "$isUnique$">> .. and the tabs macro gets a new parameter isUnique
> too. .. So no need to change the core tabs macro anymore, just to give it
> a state with a different behaviour.
>
> .....
>
>
>> My use case is to put some table properties created interactively by user
>> when Shiraz dynamic table is used. Each table uses a state tiddler like
>> $:/keepstate/dtable/xxx/xxxx/???
>> so, one time is created I do not need to explicitly refer to it!
>>
>> I cannot use variable or fields here, as I do not know how many tables a
>> user created per tiddler.
>>
>
> *Can you provide a link to some of your state creation tiddler and some
> code that uses those macros? *.. I have no idea what Shiraz tables do and
> how they are created.
>


I will push a new update but at the moment you can find these macros here

https://kookma.github.io/TW-Shiraz/#demo%2Fdynamic-tables-numerical-summary:demo%2Fdynamic-tables-numerical-summary%20demo%2Fdynamic-tables%2Fcustom-numerical-summary%20demo%2Fdynamic-tables%2Ftransclusion

A table is created using table-fd macro. Then the use in UI wants to add
numerical summary like average of midterm score.
These summaries are stored in a state tiddler like keepstate defined like
below

\define keepstate()
$:/keepstate/dynamictables/$(currentTiddler)$/$(stateTiddler)$

and currentTable is a variable defined as
currentTable=<<qualify $stateTiddler$>>


Two issues here
- if in another session qualify generate another cryptic string, then table
will lose its connection to its state
- if one rename the host tiddler the connection to state tiddler breaks
again! BUT thanks to relink plugin, if it installed this issue has gone!
- if the host tiddler (the one has a dynamic table) is transcluded through
tabs, scripts, ... again the currentTable variable will change (a
consequence of qualify macro behavior) again table will lose its
stateTiddler (this case is partially addressed in Shiraz)

I thought the kind of stateTiddler required in cases like dynamic tables is
of permanent type! if they removed (like $:/state and $:/temp) when
a session is terminated or their title changed because of qualify working
mechanism



> The qualify macro code has a "hidden feature" that isn't exposed to wiki
> users. ... It creates the unique hash based on the "transclusion"
> variable in the widget tree. ... transclusion is the default variable
> name defined by the code
> <https://github.com/Jermolene/TiddlyWiki5/blob/04c28ba5f23dc62c0be68c45e403fb7ebd497984/core/modules/widgets/widget.js#L240>.
>
>
> This variable name could be assigned by users, but the qualify macro
> doesn't use this name atm. .. I did experiment, if it could be used to
> create predictable unique states. ... BUT the mechanism only creates
> headaches.
>
> -m
>
> --
> 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/a6ded49c-677e-4e38-85ac-985a4216a0e8%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/a6ded49c-677e-4e38-85ac-985a4216a0e8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAAV1gMC%2Bt2AALqDvF%2B1TaY_%3DwWLMOkE3m%2BJS%3D1hSuL3iwd%3DYZw%40mail.gmail.com.

Reply via email to