<p>Try using <code>{site.handle}</code> instead of <code>{{currentSite.handle}}</code> and it should work ok.</p>

CC BY-SA 4.0
2021-02-22T12:46:49.077Z
Here are the docs on the "object syntax" used for Entry URI formats: https://craftcms.com/docs/3.x/entries.html#entry-uri-formats - The answer given above is a shortcut for `{object.site.handle}` - good to know if you ever need to use entry data in the URI - it's all accessible under the `object` variable.
James Smith
CC BY-SA 4.0
2021-02-22T05:49:23.290Z
2021-02-22T05:49:23.290Z
revlis
<p>Multisite question.... how do I output the site into the assets path? currentSite won't work because its the admin panel, so the current site is always the default site.</p>
<p>Using the below, I will always get <code>/default/footer-content</code> with this, regardless of which site is having its field edited.</p>
<p><a href="https://i.sstatic.net/tVmVR.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tVmVR.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2021-02-22T03:14:44.993Z
So, I got this to work accounting for the ?site=foo parameter in entries and the /admin/globals/foo/globalsethandle formats used in globals .... but this feels ultra fragile. 

`{{ craft.request.getParam('site')|length ? craft.request.getParam('site') : craft.request.getSegment(2) }}/footer-content`
cherrykoda
<assets><multi-site><assets-field>
How do you insert the site name into a default asset path?
# How do you insert the site name into a default asset path?

(Asked by: username_0 on 2021-02-20)

Multisite question.... how do I output the site into the assets path? currentSite won't work because its the admin panel, so the current site is always the default site.

Using the below, I will always get `/default/footer-content` with this, regardless of which site is having its field edited.

[![enter image description here](https://i.sstatic.net/tVmVR.png)](https://i.sstatic.net/tVmVR.png)

**Tags:** assets, multi-site, assets-field

> **Comments:**
> **username_0**: So, I got this to work accounting for the ?site=foo parameter in entries and the /admin/globals/foo/globalsethandle formats used in globals .... but this feels ultra fragile.   `{{ craft.request.getParam('site')|length ? craft.request.getParam('site') : craft.request.getSegment(2) }}/footer-content`  

---

## 1 answers

### Answer by username_1 on 2021-02-22. Score: 4 | Accepted answer

Try using `{site.handle}` instead of `{{currentSite.handle}}` and it should work ok.

> **Comments:**
> **username_2**: Here are the docs on the "object syntax" used for Entry URI formats: https://craftcms.com/docs/3.x/entries.html#entry-uri-formats - The answer given above is a shortcut for `{object.site.handle}` - good to know if you ever need to use entry data in the URI - it's all accessible under the `object` variable.  

---

