---
title: 'How do i access different media types?'
url: 'https://getgrav.org/forum/general/how-do-i-access-different-media-types-t6248'
markdown: 'https://getgrav.org/forum/general/how-do-i-access-different-media-types-t6248.md'
date: '2026-06-21'
description: 'I am trying to access a glft file, which is a 3d format I have added this to the media.yaml config glft: type: file thumb: media/thumb.png mime:'
---

[General](https://getgrav.org/forum/general)

#  How do i access different media types? 

  Started by Dean Bateman 5 years ago · 3 replies · 771 views    

 [5 years ago](https://getgrav.org/forum/general/how-do-i-access-different-media-types-t6248#post-33001 "Permalink") 

I am trying to access a glft file, which is a 3d format

I have added this to the media.yaml config

```yaml
  glft:
    type: file
    thumb: media/thumb.png
    mime: application/json
    image: null
```

then added this to a template to access the file

```twig
{% set my_model1 = page.media['Tripod Grip.gltf'] %}
{% set my_model2 = page.find('/images/3d-viewer').media['Tripod Grip.gltf'] %}

<text src="{{ my_model1 }}"></text>
<text src="{{ my_model2 }}"></text>
```

I have nominated two places to check if it makes a difference, but it returns src unknown.

i swapped the glft with searching for a png and it works so the code seems ok

is there anything else i need to do to enable grav to access different file types

 [5 years ago](https://getgrav.org/forum/general/how-do-i-access-different-media-types-t6248#post-33002 "Permalink") 

@dean\_007, Don't know the file format `gltf`, but when Googling a bit, I found:

```
mime: model/gltf+json
```

Maybe that works?

 [5 years ago](https://getgrav.org/forum/general/how-do-i-access-different-media-types-t6248#post-33003 "Permalink") 

> **@pamtbaau:**
> `model/gltf+json`

i have just tried this but no change just comes back as empty / src unknown

 [5 years ago](https://getgrav.org/forum/general/how-do-i-access-different-media-types-t6248#post-33004 "Permalink") 

ok stupid mistake, its a typo in the file ext ☺️

```yaml
  gltf:
    type: gltf
    thumb: media/thumb.png
    mime: model/gltf+json
    image: null
```

```twig
{% set my_model1 = page.media[page.header.model].url|e %} 
{% set my_model2 = page.find('/images/3dviewer').media[page.header.model].url|e %}
```

model 1 from page
model2 from images/3d viewer folder

last edited 07/01/21 by Dean Bateman

[Log in](https://getgrav.org/login?return=%2Fforum%2Fgeneral%2Fhow-do-i-access-different-media-types-t6248) to reply.

###  Suggested topics

 | Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| [SSL-Error](https://getgrav.org/forum/general/ssl-error-t9502)    [General](https://getgrav.org/forum/general) · by Hanns Mattes, 3 days ago |  | 0 | 51 | [3 days ago](https://getgrav.org/forum/general/ssl-error-t9502 "by Hanns Mattes") |
| [localhost, Windows, bin/grav server: core upgrade deletes system/router.php, and bin/grav disappears after the server is stopped](https://getgrav.org/forum/general/localhost-windows-bin-grav-server-core-upgrade-deletes-system-router-php-and-bin-grav-disappears-after-the-server-is-stopped-t9495)    [General](https://getgrav.org/forum/general) · by Dima, 1 week ago |  | 1 | 100 | [1 week ago](https://getgrav.org/forum/general/localhost-windows-bin-grav-server-core-upgrade-deletes-system-router-php-and-bin-grav-disappears-after-the-server-is-stopped-t9495 "by pamtbaau") |
| [Proposal to list Commercial Themes + Plugins in GPM. Your thoughts are requested...](https://getgrav.org/forum/general/proposal-to-list-commercial-themes-plugins-in-gpm-your-thoughts-are-requested-t9490)    [General](https://getgrav.org/forum/general) · by pamtbaau, 2 weeks ago |  | 0 | 154 | [2 weeks ago](https://getgrav.org/forum/general/proposal-to-list-commercial-themes-plugins-in-gpm-your-thoughts-are-requested-t9490 "by pamtbaau") |
| [Multi-site health/status monitor for GRAV](https://getgrav.org/forum/general/multi-site-health-status-monitor-for-grav-t9425)    [General](https://getgrav.org/forum/general) · by lynbor, 2 months ago |  | 5 | 674 | [3 weeks ago](https://getgrav.org/forum/general/multi-site-health-status-monitor-for-grav-t9425 "by lynbor") |
| [Unified Login system - you might need to reset your password](https://getgrav.org/forum/general/unified-login-system-you-might-need-to-reset-your-password-t9463)    [General](https://getgrav.org/forum/general) · by Andy Miller, 1 month ago |  | 0 | 392 | [1 month ago](https://getgrav.org/forum/general/unified-login-system-you-might-need-to-reset-your-password-t9463 "by Andy Miller") |
