Le samedi 19 septembre 2015 12:28:13 UTC+2, Hegart Dmishiv a écrit :
>
> This is my first attempt at displaying content programmatically within a 
> tiddler. Well, almost my first anyway. I have successfully displayed a 
> tiddler field in the text of the same tiddler itself, using 
> {{!!fieldname}}, but apart from that this is all new territory for me.
>
> As you'll see from the attached screenshot, I'm trying to build a list of 
> definitions of technical terms, using a <$list>..</$list> code block, 
> containing <$view field="fieldname" /> elements. But I'm trying to format 
> the results as a definition list using the semicolon and colon tags. This 
> clearly isn't quite working for me, and I was wondering how to make it work 
> properly. My logic seems sound, and it is displaying the results I 
> expected, but not with the formatting I had hoped for.
>
> I've tried looking at the official TW5 documentation, searching through 
> the forums, and staring blankly for many long hours at *@Tobi's* example 
> code <https://tobibeer.github.io/tw/xlist/#Examples>, as mentioned in another 
> recent discussion thread 
> <https://groups.google.com/d/msg/tiddlywiki/6RjPa6KEl-k/zsr87jS_AQAJ>, 
> but I still can't work it out. I guess I need to be using a <dl>..</dl> 
> code block rather than <$list>..</$list>, but I cannot work out how to 
> change the parameters in Tobi's example to make them do what I am trying to 
> do.
>

 The first issue you're encountering here is that the term/definition 
syntax is "block mode", so you need a linebreak after your entering list 
(else the whole content of the list is parsed as inline mode, and the 
term/definition syntax is not recognized):

<$list filter="[tag[Definitions]]">

; <$view field="title"/>
: <$transclude field="defn"/>
</$list>

You can then have another issue: each ";    :" syntax for the definition 
will be its own definition list, and you will have margins after each 
term/definition couple.
If you want to avoid that, you have to switch to HTML, in order to declare 
the definition list outside the list widget (and this way you don't need 
the extra linebreak...):

<dl>
<$list filter="[tag[Definitions]]">
<dt><$view field="title"/></dt>
<dd><$transclude field="defn"/></dd>
</$list>
</dl>


-- 
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 http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9525ce3e-6c3c-4923-b7b1-c12f4b7dd4be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to