Hi Jeff, Jed,

> Is it possible to get the size of a list filter into a variable?

Not currently, no. There’s an enhancement already in the 5.1.14 prerelease that 
provides part of the answer: filtered transcluded attributes. These are 
attributes that return the first entry of a filtered list. For example:

<div data-my-value={{{ [<currentTiddler>get[document]] }}}>
…

The other part is that we need a “count” filter operator (at the moment, 
there’s only a count widget. The count filter operator would allow one to do 
things like:

<table colspan={{{ [tag[special]count[]] }}}>
…

I think it’s worth adding a “count” filter; I’ve also come across cases where 
it would be useful.

> The problem is that the list widget does everything. Almost every component 
> of tiddlywiki that is displayed is displayed inside a list widget, from the 
> order of the tiddlers in the story river to the buttons on each tiddler. 
> Unfortunately this means that anything you do to the list widget has 
> unintended consequences. a while ago Tobias made a modification to the list 
> widget that would give you the index of the current item of the list. It was 
> very useful, unfortunately it turns out that it also interferes with some of 
> the optimisations needed to make tiddlywiki run reasonably.

To clarify, Jed’s referring to the fact that we can’t extend the list widget to 
provide a variable with the count of the number of entries because it is 
optimised to re-use the widget and DOM trees of list entries through the 
insertion and deletion of entries.

> Recently there has been some more discussion about this and I think that the 
> current consensus is that we should just make another widget that does what 
> the list widget does but without the optimisation so we can include things 
> like giving a count of the number of things in a list. I think someone said 
> they would work on it but I don't know if any progress has been made.

Good idea. We need a name for the new widget; perhaps “repeat” or “loop”? 
(Possibly best discussed via a GitHub ticket, if there isn’t one already)

Best wishes

Jeremy.



> On 5 Feb 2017, at 20:09, Jed Carty <[email protected]> wrote:
> 
> The problem is that the list widget does everything. Almost every component 
> of tiddlywiki that is displayed is displayed inside a list widget, from the 
> order of the tiddlers in the story river to the buttons on each tiddler. 
> Unfortunately this means that anything you do to the list widget has 
> unintended consequences. a while ago Tobias made a modification to the list 
> widget that would give you the index of the current item of the list. It was 
> very useful, unfortunately it turns out that it also interferes with some of 
> the optimisations needed to make tiddlywiki run reasonably.
> 
> Recently there has been some more discussion about this and I think that the 
> current consensus is that we should just make another widget that does what 
> the list widget does but without the optimisation so we can include things 
> like giving a count of the number of things in a list. I think someone said 
> they would work on it but I don't know if any progress has been made.
> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/tiddlywiki 
> <https://groups.google.com/group/tiddlywiki>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/85e52fd9-b55d-4b7a-b159-0eabff6acc2e%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywiki/85e52fd9-b55d-4b7a-b159-0eabff6acc2e%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/53F78E87-A85C-4EB0-A0D5-2D7CAD82C650%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to