<p>You'll need to use the global set's element ID as the <em>reference</em> part (second segment) of the <a href="http://buildwithcraft.com/docs/reference-tags" rel="nofollow noreferrer">reference tag</a>:</p>

<pre><code>{globalset:51:siteUrl}
</code></pre>

<p>To find the global set's ID, go to CP -> Settings -> Globals. The URL to the global set will have the ID as the last segment (e.g. <code>http://yoursite.craft.dev/admin/settings/globals/51</code>)</p>

<p>Also, see the this SE thread for a little more info: <a href="https://craftcms.stackexchange.com/questions/1796/how-can-i-use-a-reference-tag-with-a-global-set-using-the-handle-not-the-id">How can I use a reference tag with a global set using the handle (not the ID)</a></p>

CC BY-SA 3.0
2015-06-08T10:07:56.233Z
2015-06-08T19:50:08.117Z
2017-04-13T12:51:00.200Z
Mats Mikkel Rummelhoff
<p>I have a <code>{{ siteURL }}</code> tag inside a matrix plain text field. But it does only render as a tag and isn't beeing converted to the actual url.</p>

<p>Accoring to <a href="https://craftcms.stackexchange.com/questions/1268/is-it-possible-to-use-twig-in-a-rich-text-field">this post</a> one way is to use <a href="http://buildwithcraft.com/docs/reference-tags" rel="nofollow noreferrer">reference tags</a>.</p>

<p>So I write inside the matrix plain text field: <code>{ globalset:siteUrl }</code> and in the template I write:</p>

<pre><code>{% for block in siteDropdown.matrixDropdown %}
   &lt;li&gt;
     &lt;a href="{{ block.cellLink|parseRefs|raw }}"&gt;{{ block.cellLinkTitle }}&lt;/a&gt;
    &lt;/li&gt;
{% endfor %}
</code></pre>

<p>But this does nothing but print the tag itself. What am I missing?</p>

<templating><matrix><globals><reference-tags>
Reference tags inside Matrix textfield
# Reference tags inside Matrix textfield

(Asked by: username_0 on 2015-06-08)

I have a {{ siteURL }} tag inside a matrix plain text field. But it does only render as a tag and isn't beeing converted to the actual url.
Accoring to this post one way is to use reference tags.
So I write inside the matrix plain text field: { globalset:siteUrl } and in the template I write:
{% for block in siteDropdown.matrixDropdown %}
   
     {{ block.cellLinkTitle }}
    
{% endfor %}

But this does nothing but print the tag itself. What am I missing?

**Tags:** templating, matrix, globals, reference-tags

---

## 1 answers

### Answer by username_1 on 2015-06-08. Score: 2 | Accepted answer

You'll need to use the global set's element ID as the reference part (second segment) of the reference tag:
{globalset:51:siteUrl}

To find the global set's ID, go to CP -> Settings -> Globals. The URL to the global set will have the ID as the last segment (e.g. http://yoursite.craft.dev/admin/settings/globals/51)
Also, see the this SE thread for a little more info: How can I use a reference tag with a global set using the handle (not the ID)


---

