Trying to figure out how to get the "name" and "handle" of an asset volume, given the volume ID. Tried all the obvious things, no luck!

2 Answers 2


The Volumes service is available via craft.app.volumes, so you can do

{% set volume = craft.app.volumes.getVolumeByHandle('volumeHandle') %}
{{ volume.name }}


{% set volume = craft.app.volumes.getVolumeById(123) %}
{{ volume.name }}

Additionally, if you have an Asset model available, you can get its volume like this:

{% set volume = asset.volume %}
{{ volume.name }}

Figured it out:

{% set query = craft.assets.volume('volumeHandle').one() %}
{{ query.volume.name }}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.