Is there either a built-in widget/macro or a well-known community tool to take a potentially long list and show the first few, adding an expandable section with the remainder hidden behind a show/hide toggle listing how many more are in the list?
For instance, perhaps I want to show up to five elements, but if there are more than five, to show the first four and an indicator of how many remain, turning
Thank you both. Both tested, both are working for my use-case. Not sure which I’ll use yet, or whether I’ll just try to learn enough from them to do my own, but I very much appreciate the help.
@Scott_Sauyet in addition to the examples so far, there are ways to leverage html and CSS behaviours, especially in tables, using “overflow” to give rise to content pages. ie makes scrollable or multipage click for next content.
Is it possible to combine this with transclusion? Where each item in the list is a tiddler and I want from the long list of tiddlers to display the text from only first 10 or so?
The template param can specify a custom tiddler that defines the desired output for each item (the <<currentTiddler>> value). To transclude the content of each matching tiddler, just create a separate tiddler (e.g., “MyMoreTemplate”), containing something like this:
It now provides a pre-defined more-transclude macro template, so you don’t need to add a custom template tiddler for showing transcluded content. You can just write:
Both your suggested template and your updated more macro worked perfectly for me! I ended up using both, your macro by default and the template when I wanted to transclude a different field instead of the text. Thanks a lot!