<$set name=input value="true">
<$list filter="[<input>match[true]else[false]]" variable=returned>
</$list>
<$set>
<$list filter="[<returned>match[true]]">
</$list>
<$list filter="[<returned>match[false]]">
~[[false]]
--
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 tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/14de1ca9-88ae-42ce-b729-0d3ba15eeae8%40googlegroups.com.
Hi TonyYour description is very nicely put.The curious thing for me about both the filter language and wikitext is that they both evolved from very simple initial conditions:* The filter language evolved from the idea a simple list should be a valid filter, evaluating to the titles in the list. Given the double square bracket quoting that we already had, squeezing the operators in between the opening double square brackets allowed us to add logic without taking users too far from the existing logic (“square brackets are special”)* The wikitext language evolved from binding together two parents: the wikitext syntax established with TWC and the HTML syntax for elementsBoth have now become rich and expressive languages by iterative evolution from those initial ideas.(A sore point in the design is action strings: we re-use the widget syntax, but at best its a declarative representation of procedural logic).Best wishesJeremy
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.
So with that clarification, I would suggest the methods in the case example I gave addresses many.
Most branching is about selective display and nesting.
Are you looking for something else?
Regards tony
<$list filter="[<__template__>match[default]then[$:/plugins/kookma/timelines/templates/gilan]else[$template$]]" variable=templateTiddler> <$tiddler tiddler=<<currentTiddler>> > <$transclude tiddler=<<templateTiddler>> mode=block/> </$tiddler> </$list>
Tiddlywiki is rich and wonderful now. It took me time to jump to tw5 from twc.
This history help explains to me a little of why this transition was difficult for me and where I perceive limitations.
Given the context of this thread, perhaps I can express a hard to express idea.
Html is still quite usable in tw5 but as you know actions need to be mediated through widgets and I understand why. However there is a rich source of content and methods in html5 we cant make use of because of this. I do ask myself if a few widgets, kind of widget primitives, could open more html to us, html that depends on simple JavaScript functions, For example a way to replace the onclick function, some ways to capture values resulting from html.
The idea is to perhaps enable the functionality available in html5 back into tw5 rather than the needs found in the gaps, driving new widgets into tiddlywiki. I have some understanding of the difficulties but since I am not expert in either html or javascript I find it hard to survey both to determine if this were possible.
For example could tiddlywiki respond to html submits and store the result? Accept the detail in a form into a tiddler and its fields. Since we can do the reverse.
No need to respond, just food for thought.
Regards
Tony
\define display(template)
<$set name=template value="$template$" emptyValue="$:/plugins/kookma/timelines/templates/gilan">
<$transclude tiddler=<<templateTiddler>> mode=block/>
</$set>
\end
{{tiddlername}}
Vs
{{||tiddlername}}
\define display(filter)
<$set name=filter value="$filter$" emptyValue="a default filter">
<$set name=input value={{{ $filter$ }}} emptyValue="a default">
<$list filter=<<filter>> variable=null>....
</$list>
<$transclude tiddler=<<templateTiddler>> mode=block/>
</$set></$set>
\end
<<display"afilter">>
Mohammad,
Give this example of yours I currently use another pattern for something similar. So I thought It a good time to share.
\define display(template)
<$set name=template value="$template$" emptyValue="$:/plugins/kookma/timelines/templates/gilan" variable=null>
<$transclude tiddler=<<templateTiddler>> mode=block/>
</$set>
\end
Not tested
Some points
- Use emptyValue to set the value of a variable for which no parameter was supplied
- See how I use the same name as the parameter when making the variable
- Use with variable=null because you do not need it and the containing tiddler remains the currentTiddler
I am still at a lost to know how to do the equivalent of the following with the transclude widget
{{tiddlername}}
Vs
{{||tiddlername}}Other ideas
- I almost always write my macros to operate on <<currentTiddler>> so they are more reusable.
- I like an idea I think you suggested to pass as a parameter a macro name you then execute
I also like to develop macros that you pass a filter to, code snipit;
\define display(filter)
<$set name=filter value="$filter$" emptyValue="a default filter">
<$set name=input value={{{ $filter$ }}} emptyValue="a default">
<$list filter=<<filter>> ....
</$list>
<$transclude tiddler=<<templateTiddler>> mode=block/>
</$set></$set>
\end
<<display"afilter">>
Once again this makes such macros much more reusable.
Regards