How to print code from .html in a custom module

I have a module which contains a “file” field type. This field type has the field name of “svg_file

In the file manager, I have a file called “homepage-graphic.html”. This HTML file contains the code for an SVG graphic.

The reason I have not uploaded a .svg file to the file manager is because I would then need to wrap that in an <img> tag, whereas I want the raw SVG code to be printed in my module.

When I run {{ module.svg_file }}, it prints:

https://XXXXXXX.fs1.hubspotusercontent-na1.net/hubfs/XXXXXXX/website/homepage-graphic.html

In HubL, how can I get it to print the contents of the above file, rather than reference its file URL? How can I get it to print the SVG code inside of that file?

Hi Amit_95

I had a similar problem to yours a while back.

I needed to add an svg file in code to a page. I just made a new module in the design manager and pasted the svg code in the module.html part, then added the module to the page.

So: <svg id=“my-svg” …></svg> and then style it in the css part of the design manager.