Chris,

One thing I have observed with issues such as this, is too many people look 
for "one size fits all" to the detriment of finding a good enough solution. 
In my last post I hit at a number of good enough solutions for many 
different cases. 

Perhaps the simplest method is to break the content into separate tiddlers, 
and use the tiddler title as the id (maybe with slugify), and have only one 
id per tiddler. then there will be no non unique ID's.

Also as I pointed out you could use a class, which can be non-unique, 
however you try to keep them unique.

In a separate issue I created a solution where at a click, a tiddler was 
issued a unique serial number (wiki scope), the thing is only some tiddlers 
need a unique identifier and it can be obvious when this is necessary. If 
you are concerned about this not being unique when installing in another 
wiki, you can design an export or import method that clears and reissues 
the unique ID.

There many solutions and multiple work around available in TiddlyWiki.

Tones

On Tuesday, 6 July 2021 at 02:04:14 UTC+10 clutterstack wrote:

> I'm going to admit I'm missing something, too. I'm not certain whether 
> there's a technical factor that makes ids worse in TW than in HTML, or if 
> it's just the distinction between an HTML *developer* (who can easily put 
> duplicate ids into a page) and a TW *user*  that makes them too dangerous 
> (e.g. making *id* a widget attribute would introduce problems for 
> adopters and thus for the community trying to support them).
>
> Once you're writing macros using qualify etc., because you need some 
> unique identifier for the code to work, then you get the responsibility for 
> the edge cases.
>
> I'm fuzzy on whether there's an intractable technical problem that 
> prevents, for example, a widget for an HTML datalist tag, using qualify 
> to get a unique id. I have to admit I haven't explored it, but I haven't 
> thought of a reason why it couldn't work -- just that if you put that 
> widget in twice in a row with the same attribute values, you would get two 
> elements with the same id, so if policy is that a widget should not allow 
> a user to do that, then...but even then, surely there's technically a way 
> to generate a unique id for each instance? 
>
> I admit it gets messy (have to be able to keep track of and refer to that 
> id), and the more complicated it gets, the more attractive other 
> complicated-seeming solutions become (thinking about keyboard-driven-input).
>
> So, those are my thoughts today on that topic! Ha. I have been wondering. 
> I'm more satisfied now that I've thought it through, but still curious 
> about further insights.
>
> Best,
> Chris
>
> On Friday, July 2, 2021 at 12:56:58 PM UTC-4 Mat wrote:
>
>> In HTML one can apply an ID attribute to objects. I know this is not 
>> possible in TW... but I don't get why. Can someone explain why this is not 
>> possible or not appropriate, please.
>>
>> I have some ideas but need to understand this issue before going further.
>>
>> Thanx
>>
>> <:-)
>>
>

-- 
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/f32c018b-4725-4fbd-ab77-b13e0dbdd7c6n%40googlegroups.com.

Reply via email to