<p>Assuming the Assets field on your block has a handle of <code>asset</code>, you could do:</p>
<pre class="lang-twig prettyprint-override"><code>{object.asset.one().kind}/{owner.slug}
</code></pre>

CC BY-SA 4.0
2021-10-13T07:03:56.250Z
I already tried this approch:
The Asset field’s Default Asset Location setting has an invalid subpath (“{object.asset.one().kind}/{owner.slug}”).
pepe
CC BY-SA 4.0
2021-10-13T08:13:35.463Z
This works. What's the handle of your Assets field?
Oli
CC BY-SA 4.0
2021-10-12T12:04:28.890Z
2021-10-12T12:04:28.890Z
Oli
<br>
I want to create asset subfolders by page & by asset type.<br>
I use an asset field in an matrix field for multiple asset types like video, images etc.
<br><br>In an asset field I can access the slug of an entry by:
<pre><code>{owner.slug}
</code></pre>
<p>Is there a way to access a an asset field inside an matrix block to fetch the kind for the asset subfolder? Like</p>
<pre><code>{asset.kind}/{owner.slug}
</code></pre>
<p>To create an subfolder like</p>
<pre><code>images/about-us/asset.jpg
</code></pre>

<assets><matrix>
Access Asset Type for subfolder
# Access Asset Type for subfolder

(Asked by: username_0 on 2021-10-11)

I want to create asset subfolders by page & by asset type.
I use an asset field in an matrix field for multiple asset types like video, images etc.
In an asset field I can access the slug of an entry by:
{owner.slug}

Is there a way to access a an asset field inside an matrix block to fetch the kind for the asset subfolder? Like
{asset.kind}/{owner.slug}

To create an subfolder like
images/about-us/asset.jpg

**Tags:** assets, matrix

---

## 1 answers

### Answer by username_1 on 2021-10-12. Score: 1

Assuming the Assets field on your block has a handle of asset, you could do:
{object.asset.one().kind}/{owner.slug}

> **Comments:**
> **username_0**: I already tried this approch: The Asset field’s Default Asset Location setting has an invalid subpath (“{object.asset.one().kind}/{owner.slug}”).  
> **username_1**: This works. What's the handle of your Assets field?  

---

