Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 4444caa

Browse files
authored
Add instructions for JSON linking
1 parent b7daf39 commit 4444caa

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

docs/data-link-variable.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,26 @@ You can build patterns that link to one another to help simulate using a real we
88

99
{% raw %}{{ link.pattern-name }}{% endraw %}
1010

11-
For example, if you wanted to add a link to the `article` template from your `blog` template you could write the following:
11+
For example, if you wanted to add a link to the `article` page from your `blog` page you could write the following:
1212

13-
<a href="{% raw %}{{ link.templates-article }}{% endraw %}">Article Headline</a>
13+
<a href="{% raw %}{{ link.pages-article }}{% endraw %}">Article Headline</a>
1414

1515
This would compile to:
1616

17-
<a href="/patterns/templates-layouts-article/templates-layouts-article.html">Article Headline</a>
17+
<a href="/patterns/pages-layouts-article/pages-layouts-article.html">Article Headline</a>
1818

19-
As you can see, it's a much easier way of linking patterns to one another.
19+
Additionally, you can use pattern links within JSON to link to other pages, templates, or patterns within Pattern Lab. For instance, if you had a pattern containing the following:
20+
21+
```
22+
<a href="{% raw %}{{ url }}{% endraw %}">This is a link</a>
23+
```
24+
25+
You can set the URL to a pattern link via JSON like so:
26+
27+
```
28+
{
29+
"url" : "link.pages-article"
30+
}
31+
```
32+
33+
Using pattern links in JSON is especially helpful at keeping the pattern's structure and content entirely separate.

0 commit comments

Comments
 (0)