CMS Development

RoFiks
Member

Use portal ID variable in fields.json

Hi there,

 

Is it possible to use a variable, like the {{ portal_id }} in a fields.json file of a module? I would like to use a default value for a URL field linking to a mp4 file in my custom theme folder. When I use 

 

 "default" : {
    "content_id" : null,
    "href" : "https://f.hubspotusercontent10.net/hubfs/{{ portal_id }}/media/example.mp4",
    "type" : "EXTERNAL"
  }

 

the {{ portal_id }} variable isn't working. Is there a solution to this?

 

Thanks for your help!

1 Reply 1
GRajput
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Use portal ID variable in fields.json

Hi @RoFiks 

Nope because in field.json we can only write HubSpot fields in JSON format. But you can set the default value of the URL field which can do in that field also in your template. Use { "default": "Your Value" }.

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


0 Upvotes