Reference Tags


Craft’s reference tags work in Markdown fields, and are resolved when the field renders. Parse Reference Tags is on by default.

Md
[Read the docs]({entry:123:url}), see also {entry:my-section/some-entry:title}.

![Diagram]({asset:456:url})

They’re resolved on the way out, not on save, so an entry that changes its slug doesn’t leave a trail of dead links behind it. An unresolvable tag falls back to whatever Craft’s fallback syntax says, or to the tag itself:

Md
{entry:999:title || Something else}

Two things worth knowing:

  • Code is left alone. A tag in a fenced block or an inline code span renders as the author typed it, which is what you want when the thing you’re documenting is reference tags. Tags are resolved after parsing, when the parser has already decided what counts as code, so nothing here second-guesses Markdown’s fence rules.
  • Resolved values are purified. Whatever a tag resolves to goes through HTML Purifier along with the rest of the content, assuming Purify HTML is on.

On a multi-site install, tags resolve against the site the element is being rendered in. Override that per tag with Craft’s own @ syntax, {entry:123@german:url}, or for a whole render with {{ text|marky(siteId=2) }}.