Macro display issue

54 views
Skip to first unread message

Reece Shaw

unread,
Mar 28, 2019, 9:00:22 PM3/28/19
to TiddlyWiki
Hey all,

Currently, I'm using two macros to shortcut some field displays from a set of data tiddlers. One simply links to the target field of a data tiddler, where the other displays the target field and renders it as wiki text.

\define vf-link(field)
<$list filter="[is[current]has[$field$]]">
<$reveal type="nomatch" stateTitle=<<currentTiddler>> text="">
<$link to={{!!$field$}}>{{!!$field$}}</$link></$reveal>
</$list>
\end

\define vf-display(field)
<$list filter="[is[current]has[$field$]]"><$reveal type="nomatch" stateTitle=<<currentTiddler>> text="">
<$wikify name="md" text={{!!$field$}} type="text/x-markdown" output="html"><<md>></$wikify>
</$reveal>
</
$list>
\end

The vf-display macro when rendering automatically inserts a line break before and after the displayed text. The code in question for my UI template looks like this:

This character is a <<vf-display "level-cr">> <<vf-link "heritage">> <<vf-link "ancestry">> <<vf-link "class">>
But it displays like:

This character is a

level-cr

Link-heritage Link-ancestry Link-class

Any advice how I could get it to look like:

This character is a level-cr Link-heritage Link-ancestry Link-class

I would prefer to keep this as modular as possible and refrain from using another macro for this specific instance. The full wiki is here for more context.

Thanks,

Reece, the Discord guy

Mohammad

unread,
Mar 28, 2019, 11:57:23 PM3/28/19
to TiddlyWiki
Hi Reece,

Try the modified vf-display below

\define vf-display(field)
<$list filter="[is[current]has[$field$]]"><$reveal type="nomatch" stateTitle=<<currentTiddler>> text=""><$wikify name="md" text={{!!$field$}} type="text/x-markdown" output="html" mode="inline"><<md>></$wikify></$reveal></$list>
\end

Note to the wikify widget mode attribute mode="inline">

Mohammad

Reece Shaw

unread,
Mar 29, 2019, 7:11:27 PM3/29/19
to tiddl...@googlegroups.com
Ah, perfect, that did it. Was not familiar previously with the widget mode attributes. Thanks Mohammad, keep up the good work with Commander!

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/0Toq7r0-P_Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5e9b8542-6305-43a2-9dbe-0a0681b8ecf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages