CMS Development

mIIwaukee
Contributor | Diamond Partner
Contributor | Diamond Partner

HubDb Video

Hi,

 

I created a hubdb table for videos. There's a column that allows selection of a video file (mp4). When I want to display the table, I can't seem to display the file path for the video. Any ideas?

 

{{row.video}} shows the ID

 
0 Upvotes
8 Replies 8
ATBKonzepthaus
Participant | Diamond Partner
Participant | Diamond Partner

HubDb Video

Having a similar case, have you found any workaround since?

0 Upvotes
Chris-M
Top Contributor

HubDb Video

Hello @mIIwaukee,

to embed the video with hubspot you need to give the video a player:

 

{% video_player "embed_player" player_id="{{row.video}}" %}

 

- Chris

mIIwaukee
Contributor | Diamond Partner
Contributor | Diamond Partner

HubDb Video

Thanks Chris. I am looking for a file path url, not the ID.

Mark
0 Upvotes
stefen
Key Advisor | Partner
Key Advisor | Partner

HubDb Video

@mIIwaukee you should be able to use the file_by_id HubL function to get the URL. Here's an example:

 

{% set file = file_by_id(row.video) %} 
{{ file.friendlyUrl }}

 

Stefen Phelps, Community Champion, Kelp Web Developer
mIIwaukee
Contributor | Diamond Partner
Contributor | Diamond Partner

HubDb Video

Thanks Stefen,

 

This was my thought too,  but it doesn't work. 

 
 {%- for row in table%}   
{{row.video}} 
{% set file = file_by_id(row.video) %}
{{ file.friendlyUrl }} 
{%- endfor %}
 

{{row.video}} outputs an ID

{{ file.friendlyUrl }}  outputs nothing

 

mark

0 Upvotes
stefen
Key Advisor | Partner
Key Advisor | Partner

HubDb Video

@mIIwaukee try outputting {{ file|pprint }} to see if there is anything that outputs. It may be that the video ID is not the same as a file ID unfortunately... 

Stefen Phelps, Community Champion, Kelp Web Developer
0 Upvotes
mIIwaukee
Contributor | Diamond Partner
Contributor | Diamond Partner

HubDb Video

Hi Stefan,

 

Thanks, in this case it's NULL

 

{%- for row in table%}   
{{row.video}}
{% set file = file_by_id(row.video) %}
{{ file.friendlyUrl }} 
{{ file|pprint }} 
{%- endfor %}
 
 
 

m

0 Upvotes
natsumimori
Community Manager
Community Manager

HubDb Video

Hi @mIIwaukee ,

 

I will tag in some subject matter experts here.

@psdtohubspot and @stefen , could you share thoughts for @mIIwaukee ?

0 Upvotes