# How to get document name in module html

**URL:** <https://community.hubspot.com/t/how-to-get-document-name-in-module-html/43621>\
**Category:** CMS Development\
**Created:** [September 9, 2021, 9:55pm UTC](https://community.hubspot.com/t/how-to-get-document-name-in-module-html/43621 "2021-09-09T21:55:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pixton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pixton/32/96589_2.png) [@Pixton](https://community.hubspot.com/u/Pixton)\
**Post date:** [September 9, 2021, 9:55pm UTC](https://community.hubspot.com/t/how-to-get-document-name-in-module-html/43621/1 "2021-09-09T21:55:00Z")

</div>

I have a custom module. One of the fields is of type **File** , and the “File type” is **Document**. The field is called **resources** and is repeating.  
If I write the following, I get a list of resources, but only the URL is displayed:

```lia-code-sample
<ul>
 {% for resource in module.resources %}
 <li><a href="{{ resource }}">{{ resource }}</a></li>
 {% endfor %}
</ul>

```

But I’d like to make use of the document name as well as its URL. Ideally something like:

```lia-code-sample
<ul>
 {% for resource in module.resources %}
 <li><a href="{{ resource.url }}">{{ resource.name }}</a></li>
 {% endfor %}
</ul>

```

But **url** and **name** (or **title** ) aren’t recognized properties of resource.

Is this possible?

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [September 10, 2021, 7:59am UTC](https://community.hubspot.com/t/how-to-get-document-name-in-module-html/43621/2 "2021-09-10T07:59:34Z")

</div>

Hi @Pixton ,

You can use the **|pprint** filter to check the contents of a variable. So use {{resource|pprint}} to check what is available. This won’t solve your current issue tho, just a tip.

If I am not mistaken, the name of the file should be available in the URL, so you could use a filter to strip out part of the URL and it should leave you with the name of the file, correct?  
You could try using the [regex\_replace](https://developers.hubspot.com/docs/cms/hubl/filters#regex-replace) or the [replace](https://developers.hubspot.com/docs/cms/hubl/filters#replace) filter.

If you need help with that, let me know!

---

<div class="post-metadata">

**Author:** ![Pixton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pixton/32/96589_2.png) [@Pixton](https://community.hubspot.com/u/Pixton)\
**Post date:** [September 13, 2021, 3:54pm UTC](https://community.hubspot.com/t/how-to-get-document-name-in-module-html/43621/3 "2021-09-13T15:54:23Z")

</div>

Thank you, @Teun! That’s super helpful.
