Skip to content

Commit

Permalink
Merge branch 'tiddlywiki-com'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jermolene committed Mar 10, 2024
2 parents 967e2b7 + 78a09fc commit 1222bed
Show file tree
Hide file tree
Showing 20 changed files with 657 additions and 512 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ tags: Learning
title: Concatenating text and variables using macro substitution
type: text/vnd.tiddlywiki

!! Important

<<.from-version "5.3.0">> It is recommended to use [[substituted attributes|Substituted Attribute Values]] or the [[substitute filter operator|substitute Operator]] to concatenate text and variables.

It's a frequent use case in ~TiddlyWiki that you will want to put the results of variables together with various bits of strings of text. This process in some programming languages is often referred to as "concatenating" text.

---

!! What is Wrong

You might, for instance want to set up a template for your customer database, where links will automatically refer to additional contact information about your customer. Inside your tiddler, you might try something like this:

<<.bad-example "`[[Additional Info|<<currentTiddler>>-Contact]]`">>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
code-body: yes
created: 20150221145803000
modified: 20240310124126491
title: $:/editions/tw5.com/macro-examples/tags-of-current-tiddler
type: text/vnd.tiddlywiki

\define tags-of-current-tiddler() {{!!tags}}
\procedure tags-of-current-tiddler() {{!!tags}}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
code-body: yes
created: 20150228123855000
modified: 20150228123921000
modified: 20240310133309881
title: $:/editions/tw5.com/macro-examples/tv-get-export-image-link
type: text/vnd.tiddlywiki

\define tv-get-export-image-link(src) https://www.tiddlywiki.com/$src$
\function tv-get-export-image-link(src) [[https://www.tiddlywiki.com/$(src)$]substitute[]]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
code-body: yes
created: 20150228120252000
modified: 20240310124217005
title: $:/editions/tw5.com/macro-examples/tv-wikilink-tooltip
type: text/vnd.tiddlywiki

\define tv-wikilink-tooltip()
\procedure tv-wikilink-tooltip()
<$transclude field="tooltip">(<$transclude field="caption"/>)</$transclude>
\end
Loading

0 comments on commit 1222bed

Please sign in to comment.