<p>I have an asset field within a matrix block, for which uploads are restricted to a single folder. The upload location path is set to <code>{owner.section.handle}/{owner.slug}</code>. Using this pattern the asset is uploaded to the correct folder on save, however it's not possible (even after the entry has been saved previously) to view and pick existing assets from this folder - it always appears empty in the asset picker.</p>

<p>It seems like it's related to this question: <a href="https://craftcms.stackexchange.com/questions/4863/assets-content-fields-not-available-until-entry-is-saved">Assets Content/Fields not available until entry is saved?</a> but specifically to do with accessing the <code>{owner.section.handle}</code> of the field.</p>

<p>The use-case for this is that it allows a single matrix field (with asset pickers) to be shared between sections but still have the assets saved to a section-specific subfolder.</p>

<p>I assume this is a bug? If so, is there any other way to achieve this behaviour to prevent me having to duplicate the matrix field and hard-code the section in the path for each section?</p>

CC BY-SA 3.0
2015-06-09T14:52:39.657Z
Hi we have exactly the same issue. We don't use the slug but it still occurs with just {owner.section.handle} Did you ever find a fix for this?
Lettie
CC BY-SA 3.0
2015-06-10T15:32:57.067Z
No I didn't unfortunately :-( I haven't tried it yet in the v3 beta though - it may be fixed in that?
Mark Perkins
CC BY-SA 3.0
2015-06-18T17:35:25.963Z
The workaround I use is that I save the element empty first, and then begin adding assets.
Bob Olde Hampsink
<assets><entry><field><sections>
Asset dynamic subfolder paths referencing entry section not available until saved
# Asset dynamic subfolder paths referencing entry section not available until saved

(Asked by: username_0 on 2015-05-07)

I have an asset field within a matrix block, for which uploads are restricted to a single folder. The upload location path is set to `{owner.section.handle}/{owner.slug}`. Using this pattern the asset is uploaded to the correct folder on save, however it's not possible (even after the entry has been saved previously) to view and pick existing assets from this folder - it always appears empty in the asset picker.

It seems like it's related to this question: [Assets Content/Fields not available until entry is saved?](https://craftcms.stackexchange.com/questions/4863/assets-content-fields-not-available-until-entry-is-saved) but specifically to do with accessing the `{owner.section.handle}` of the field.

The use-case for this is that it allows a single matrix field (with asset pickers) to be shared between sections but still have the assets saved to a section-specific subfolder.

I assume this is a bug? If so, is there any other way to achieve this behaviour to prevent me having to duplicate the matrix field and hard-code the section in the path for each section?

**Tags:** assets, entry, field, sections
> **Comments:**
> **username_1**: Hi we have exactly the same issue. We don't use the slug but it still occurs with just {owner.section.handle} Did you ever find a fix for this?  
> **username_0**: No I didn't unfortunately :-( I haven't tried it yet in the v3 beta though - it may be fixed in that?  
> **username_2**: The workaround I use is that I save the element empty first, and then begin adding assets.  

---

## 0 answers

