이 문서는 https://tiddlywiki.com/languages/ko-KR/에서 티들리위키의 정적 HTML 표현의 일부입니다

Substituted Attribute Values

2023년 6월 15일 오후 5:30
New in v5.3.0

Substituted attribute values can use two different styles of quoting:

  • Single backticks
    attr=`value`
  • Triple backticks
    attr=```value```

The value of the attribute will be the text denoted by the backticks with any of the placeholders for filter expressions and variables substituted with their corresponding values. Filter expression placeholders are substituted before variable placeholders, allowing for further variable substitution in their returned value.

Warning
Any other wiki syntax in that text will be left as-is.

placeholder syntaxdescription
$(varname)$Text substitution of a variable. Undefined variables are replaced with an empty string.
${ filter expression }$Text substitution with the first result of evaluating the filter expression.

Examples

Substituting a variable value into a string

<$text text=`Hello there this is the tiddler "$(currentTiddler)$"`/>

That renders as:

Hello there this is the tiddler "Substituted Attribute Values"

Substituting a variable value and the result of evaluating a filter expression into a string

<$text text=`This tiddler is titled "$(currentTiddler)$" and was last modified on ${[{!!modified}format:date[DDth MMM YYYY]]}$`/>

That renders as:

This tiddler is titled "Substituted Attribute Values" and was last modified on 15일 6월 2023

Concatenating strings and variables to create a URL


<$let hash={{{ [<currentTiddler>encodeuricomponent[]] }}}>
<a href=`http://tiddlywiki.com/#$(hash)$`>this tiddler on tiddlywiki.com</a>
</$let>

That renders as:

this tiddler on tiddlywiki.com

Concatenating variables and a text reference to create a URL


<$let hash={{{ [<currentTiddler>encodeuricomponent[]] }}}>
<a href=`${ [{!!base-url}] }$#$(hash)$`>this tiddler on tiddlywiki.com</a>
</$let>

That renders as:

this tiddler on tiddlywiki.com