The focus tonight involved setting up the framework to display “expressions” in which a word might play a part.
Here is the “agrément” word, with a very basic setup to display a list of related expressions:
All of those detail elements are from a view template ($:/tags/ViewTemplate) called “Word Footer” (Previously called “Tiddler Footer”):
<$list filter="[{!!title}tag[m]]">
<$let vWord={{!!title}}>
{{Set Phonology and Spelling||tAsDc}}
{{Add Word Ensemble||tAsDc}}
<$list variable="check" filter="[tag<vWord>tag[we]tag[n]] [tag<vWord>tag[we]tag[adj]] +[nth[1]]">
{{Gender and Number||tAsDc}}
</$list>
<$list variable="check" filter="[tag<vWord>tag[we]tag[adj]nth[1]]">
{{Adjective Ensemble||tAsDc}}
</$list>
<$list variable="check" filter="[tag<vWord>tag[we]tag[n]nth[1]]">
{{Noun Ensembles||tAsDc}}
</$list>
<$list variable="check" filter="[tag<vWord>tag[we]tag[pp]nth[1]]">
{{Preposition Ensembles||tAsDc}}
</$list>
<$list variable="check" filter="[tag<vWord>tag[we]tag[pn]nth[1]]">
{{Pronoun Ensembles||tAsDc}}
</$list>
<$list variable="check" filter="[tag<vWord>tag[we]tag[v]nth[1]]">
{{Verb Ensembles||tAsDc}}
</$list>
{{Related Expressions||tAsDc}}
</$let>
</$list>
- “word” tiddlers are simply tagged with “m”.
- tAsDc is a template tiddler that displays a tiddler inside of a details element
The “Related Expressions” tiddler:
<$list variable=expr filter="[tag<vWord>tag[e]sort[]]">
<$list variable=check filter="[<expr>search[...]]">
<$tiddler tiddler=<<vWord>>>
<$transclude tiddler=<<expr>>/>
</$tiddler>
</$list>
<$list variable=check filter="[<expr>!search[...]]">
<<expr>>
</$list>
<br>
</$list>
- this is setup to handle an expression that has variants, so the “template” expression can exist once, tagged with however many words can be used alternatively in the expression, and the expression will be shown correctly for a particular word being viewed (for example:
drôle de/d' ...
, the “…” could be one of the following words: “agrément”, “moineau”, “amanchure”, etc.) - and if the expression does not have any variants, then we just show the expression tiddler’s title
The “drôle de/d’ …” tiddler:
- tagged with “e” to identify it as an “expression” tiddler
- tagged with all of the words that could be used in the “…” placeholder" for all of the variants of the expression
- the body of the tiddler provides the display template for the expression (it figures out whether “de” or “d’” should be used, depending on whether or not the word being displayed starts with a vowel
For testing purposes, the “blah blah blah agrément” expression:
- to make sure “single variant” expressions are getting grabbed and displayed correctly.
Oh, the “vowels” macro (other vowels pending):