Unlike contact properties, it is not possible to reference product property values on a web page with HubL variables.
If a website visitor's identity is associated with a known contact record, HubL can retrieve the corresponding property values. Products, however, cannot be associated with visitor identities or contact records (only deals via line items), and cannot be referenced on their own.
You could store product information in custom contact properties and use HubL variables to surface this data, but every visitor identity would need to be associated with a contact with a known value in order to see it. At that point, hard coding may be a better option.
Finally, I want to mentionHubDB again, which is by far the best tool if you wish to curate a listing of products in one place and have the data populate across your website. Check out the technical documentationhere.
Could you clarify the type of "field" you are using?
If you are storing values in custom contact properties and using HubL "personalization" tokens to render their values in your custom modules (e.g. {{ contact.firstname }}), you can absolutely set and update values via import.
I'm mostly using image and text fields, and I guess I can't really create an image field via Properties.
I think I could use fields for Product but I have a question.
I'm gonna use my custom module in another pages as well, so I guess if I change values of the fields via import, it will update the values for all the pages. Is there any workaround?
I'd probably make another custom module but there gonna be a lot of pages so I don't want to update the values manually.
While there are no "image" fields, most users upload an image link to a single-line text field and then place the token in an img tag's src attribute. For example:
The above approach only works with custom contact properties, however. It will not work for custom product properties.
If you need to display product images and descriptions, you might want to consider HubDB (keep in mind this requires the HubSpot CMS.) Check out the technical documentation here.
Unlike contact properties, it is not possible to reference product property values on a web page with HubL variables.
If a website visitor's identity is associated with a known contact record, HubL can retrieve the corresponding property values. Products, however, cannot be associated with visitor identities or contact records (only deals via line items), and cannot be referenced on their own.
You could store product information in custom contact properties and use HubL variables to surface this data, but every visitor identity would need to be associated with a contact with a known value in order to see it. At that point, hard coding may be a better option.
Finally, I want to mentionHubDB again, which is by far the best tool if you wish to curate a listing of products in one place and have the data populate across your website. Check out the technical documentationhere.