File Link Error; files upload but will not open when linked on the website

Hello,

I have been trying to link files to products on my website, but I keep recieving an error. I have uploaded the files, made them public and the website is functional. Not sure what to do, I have attached a screenshot of the error.

Hi @CMarketing6,

The URL looks a bit strange, the part that starts in the middle looks like the actual URL:

karstenkoehler_0-1743511836569.png

Can you double check that you didn’t accidentally paste into something that was there already? Clear the link field and only paste the file URL again?

Best regards

The file link will open from the file uploads, but not from the website when linked to a product. I tried pasting the file URL in as an external link instead this time, but recieved the same error. This is the message that comes up when I try to reload the page:

{"status":"error","message":"Cannot parse path {type=FILE, content_id=null, href=, href_with_scheme=}","correlationId":"01c59795-13a8-41ca-9efb-296b0ce9174c"}

@CMarketing6 can you please share the full file link here and a screenshot of the link pop-up, moving the cursor to the very left?

There will be multiple files linked, but here is one:

Also not exactly sure what you mean by link pop-up, but here is a screenshot with some more info

@CMarketing6 that indeed looks all like it’s set up correctly. Since it looks like you’re on a paid Starter subscription, I’d recommend reaching out to HubSpot support in-app, via email. They can investigate right within your portal for you.

Thanks!

Hey @CMarketing6,

are you using a custom module or a theme module?

Just asking because the initial screenshot(with the wrong URL) is the result of a sightly wrong module code.

It seems like the code misses one small addition.

If it’s a custom module it’s an easy fix. Theme(or HubSpot) modules would require a cloned version.

From what I can see the code is build something like this(at least should be):

{% for item in module.product_listing %}
...
{% set href = item.product_link.url %}
	{% if item.product_link.url.type is equalto "EMAIL_ADDRESS" %}
	 {% set href = "mailto:" + href %}
	{% endif %}
	<a
	 {% if item.product_link.url.type is equalto "CALL_TO_ACTION" %}
	 href="{{ href }}" {# The href here is not escaped as it is not editable and functions as a JavaScript call to the associated CTA #}
	 {% else %}
	 href="{{ href|escape_url }}"
	 {% endif %}
	 {% if item.product_link.open_in_new_tab %}
	 target="_blank"
	 {% endif %}
	 {% if item.product_link.rel %}
	 rel="{{ item.product_link.rel|escape_attr }}"
	 {% endif %}
	 >
	 {{ product.link_text }}
	</a>
{% endfor %}

The crucial part is

{% set href = item.product_link.url %}

It seems like the this part is missing one additional information which causes the error. Changing it to:

{% set href = item.product_link.url.href %}

Should solve the linkage errors.

best,

Anton

Hey Anton,

I am using a theme module, if I clone the page will I be able to edit the code? Or do I need to go in and clone then edit the entire theme?

Thank you for the coding help!

Hey @CMarketing6,

you need to go to the Design-Manager(Content → Design-Manager), find your theme, locate the module, right-click and say “clone module”.

If it’s a theme from the marketplace(located in the @marketplace folder), and you haven’t created a child theme before, you’ll need to create a child-theme first.

Also you’ll need to change the theme of the page(and for all future pages) from the marketplace theme to the cloned-version/child-theme so the changes you make will be applied.

Happy to provide tech help if you need some. Feel free to book a meeting(just click my signature below and find a slot that fits you)

best,

Anton