Replies: 1 comment
-
twMat, Some thoughts; I think the direction you are going needs a generic solution that new and experience users can use for common lists. This a kind of generic "report" tool, and is in some ways still catching up with the old TWC "For Each Tiddler" plugin. It are you looking at CSS only? Perhaps if the list widget or a report widget that does much the same, could allow us to include the parameters before and after or header and footer would make this easy, these parameters would transclude the styles and header handling in our list. In this way I use the term "report" as a list with headers and footers and page breaks. As you know the list widget already has a template parameter that is used for each iteration of the list items. If we want a template that includes headers eg CSV fieldnames, a table header with column titles we need additional code and for visual adjustments CSS. I have already built code that detects the first and last item when generating such lists, but other options to page every N items etc... are common needs, as is the counter you mention. Based on similar needs it seems a macro to which you provide the filter for items, and other parameters, can then count the number of items, find a field/column list, determine when to display the header and footers. In many ways this would be a list version similar to the various tables tools, rather than a table tiddler we define a report tiddler. Then the title/header, Line item and Footer templates could be named or created. My feeling is if the list macro can also provide the list item number (rather than your CSS counter) we can use it for other logic. The work on extending or customised wikitext here wikilabs/plugins#56 will also provide some smart methods to achieve what you want. You can use wikitext to use predefined list widgets and their parameters. Regards |
Beta Was this translation helpful? Give feedback.
-
Before this is posted as an Issue, I'd like to bounce it here as a Discusssion
Is your feature request related to a problem? Please describe.
I wish to easily style generated lists.
Comparable to #5438 , I propose there are premade templates that can be easily applied. As noted in #4618 it is somewhat fiddly to ensure the output elements are text (as opposed to links) and the style of the list is not easily controlled if I want e.g an ordered list.
Describe the solution you'd like
The proposal concerns the ListWidget, filtered transclusion (and if #5199 comes to fruition then also the proposed syntax form
{{mytiddler||template} variable }
). These already have atemplate
attribute. All(?) that is needed are a few templates with styles that users are likely to want. I can think of these:,
two,
threeand
four" (ref)A template and stylesheet would be simple. This gives a numbered list of text items:
The more difficult task may be to come up with appropriate template titles. As noted in a related proposal, templates should have system titles which means they're not very memory- or type friendly.
For this I'm wondering if there could be a system tiddler that is assumed by the template attribute (!) and what is fed in as template attribute argument is really the field name, or a perhaps a dictionary key. Thus
<$list filter="..." template=text-commas />
could mean thetext-commas
field in the, say,$:/.../listtemplates
tiddler.Beta Was this translation helpful? Give feedback.
All reactions