<p>I just searched this Stack Exchange and found an answer on how to get the field model from the templates: <a href="https://craftcms.stackexchange.com/a/493/125">How can I output the Field Name in my template?</a></p>

<blockquote>
  <p>You can get any field with craft.fields, which returns a FieldModel:</p>

<pre><code> {% set field = craft.fields.getFieldbyHandle('field_handle') %}
 {{ field.name }}
 {{ field.instructions }}
</code></pre>
</blockquote>

<p>Unfortunatelly, however, this won't work with fields within a Martix field. The <code>getFieldbyHandle</code> method is written for use in specific parts of the CP, where Craft knows the context the field is used in.</p>

<p>There's a <code>getFieldbyId</code> method though, which could work for your use case. The field's ID is independent from the context (inside Matrix or not).</p>

CC BY-SA 3.0
2016-01-18T09:20:57.263Z
Hi Carlcs, thanks for looking,  I should have said i'd already tried the method you also found.  I'll give the getFieldbyID a try.
Martin
CC BY-SA 3.0
2016-01-16T16:56:51.380Z
2016-01-16T16:56:51.380Z
2017-04-13T12:50:59.930Z
carlcs
<p>As the title suggests, i'm trying to output the contents of a default instructions field within a Matrix block.  I'm sure it's doable but not sure where to start?</p>

<p>Thanks</p>

<p>Martin</p>

<matrix>
Output the contents of an instructions field within a Matrix block
# Output the contents of an instructions field within a Matrix block

(Asked by: username_0 on 2016-01-16)

As the title suggests, i'm trying to output the contents of a default instructions field within a Matrix block. I'm sure it's doable but not sure where to start?

Thanks

Martin

**Tags:** matrix

---

## 1 answers

### Answer by username_1 on 2016-01-16. Score: 2

I just searched this Stack Exchange and found an answer on how to get the field model from the templates: How can I output the Field Name in my template?

You can get any field with craft.fields, which returns a FieldModel:
 {% set field = craft.fields.getFieldbyHandle('field_handle') %}
 {{ field.name }}
 {{ field.instructions }}


Unfortunatelly, however, this won't work with fields within a Martix field. The getFieldbyHandle method is written for use in specific parts of the CP, where Craft knows the context the field is used in.
There's a getFieldbyId method though, which could work for your use case. The field's ID is independent from the context (inside Matrix or not).

> **Comments:**
> **username_0**: Hi Carlcs, thanks for looking,  I should have said i'd already tried the method you also found.  I'll give the getFieldbyID a try.  

---

