- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Accessing Image Files in CMS Theme Development
SOLVEJun 19, 2020 1:52 PM
Hello,
How does one access image files while making a custom CMS theme?
I am able to upload the images using the local development tools, but can't seem to find how to get these files onto the page.
I have tried using
get_asset_url('')
but understand now that this is only used for js, html and css files.
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Accepted Solutions
Jun 22, 2020 9:03 AM
@DavidFJones when using the get_asset_url inside a HubSpot theme, you can use a relative path to the image file. Let's say your theme is structured like so:
- /images
- example.jpg
- /templates
- home.html
if you wanted to reference the example.jpg inside the home.html you would use the function like so:
{{ get_asset_url('../images/example.jpg') }}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content