Blockquote macro with parameter as link: no backlink created?

Hi, first post here.

I’m new to TiddlyWiki and trying to create a simple macro to add quotes, with 3 parameters: quote, author, and class.

Here’s what I have so far:

\define bmquote(quote, autor:"", class:"escrita")
<blockquote class={{{ [[tc-quote-]addsuffix<class>] }}}>
  <p><<quote>>&nbsp;&#8213;&nbsp;<span><<autor>></span></p>
</blockquote>
\end

The issue is with the author field (<>).

For example, when I call the macro like this:

<<bmquote "Thinking about what we can't control only wastes energy and creates its own Enemy." "[[Worf]], son of Mogh" "cinema">>

It renders [[Worf]], son of Mogh as a link, but the Worf tiddler doesn’t show the backlink.

I asked AI, and it suggested replacing <> with one of these:

Using $wikify (removes the link entirely):

<$wikify name="parsed-autor" text=<<autor>>>
  <$text text=<<parsed-autor>>/>
</$wikify>

Using $transclude:

<$transclude $variable="autor" $mode="inline"/>

Neither gives me the desired result: a clickable link and a backlink in the target tiddler.

Is there a way to keep the link and make sure the backlink appears in the linked tiddler?

Thanks in advance!

Backlinks are only available for “hard” links (i.e., a link that is directly embedded in content). However, in your use-case the link isn’t embedded in the content but is, instead, being rendered from a variable, which makes it a “soft” link.

see Hard and Soft Links, which specifically mentions that

-e

1 Like

I’d actually suggest using standard wikitext blockquotes rather than a special blockquote macro here: it won’t take up significantly more space, it will preserve your backlinks, and it’s a little easier to read, in my opinion. For instance:

<<<.tc-quote-cinema
Thinking about what we can't control only wastes energy and creates its own Enemy.
<<< [[Worf]], son of Mogh
2 Likes

I can live with that! So basically I was reinventing the wheel. Thanks!