solved YouTube Image display

mountaintop
@mountaintop
7 years ago
76 posts
Hi need help,

I'm planning to use ProJam Light skin

the skin shows the latest videos, since we only allow youtube videos I plan to display the latest youtube videos at the same location
However, I can not manage to show the video image
can anyone show me where to change to code needs to change to show the youtube video image.

I tried everything and I'm lost

template is ProJam Light index_new_videos.tpl
Capture.PNG.png
Capture.PNG.png  •  108KB




--
jesan
FRC All Music

updated by @mountaintop: 01/02/18 09:34:46PM
paul
@paul
7 years ago
4,331 posts
YouTube works a bit differently to other module wrt item image as its image is not stored locally, but is a link to the youtube servers.
Taking a look at the ProJam Light index_new_videos.tpl template, the first thing is to replace lines 46-51 with the following code -
{jrCore_list module="jrYouTube" order_by="_item_id numerical_desc" template=$new_videos_template pagebreak="3" page=$_post.p}

then line 3 is this -
{jrCore_module_url module="jrYouTube" assign="murl"}

and lines 12-13 would need to be this -
<a href="{$jamroom_url}/{$row.profile_url}/{$murl}/{$row._item_id}/{$row.youtube_title_url}"><img src="{$item.youtube_artwork_url}" alt="{$item.youtube_title|jrCore_entity_string}" class="iloutline img_scale"></a><br>
<h4><a href="{$jamroom_url}/{$row.profile_url}" title="{$row.profile_name}">{if strlen($row.youtube_title) > 20}{$row.youtube_title|truncate:20:"...":false}{else}{$row.youtube_title}{/if}</a></h4>

hth


--
Paul Asher - JR Developer and System Import Specialist
mountaintop
@mountaintop
7 years ago
76 posts
Hi Paul,

Thank you for your help, implemented the above, YouTube title is showing but image is missing

screenshot attached

I appreciate your willingness to help

Helmut
Capture.PNG.png
Capture.PNG.png  •  13KB




--
jesan
FRC All Music
michael
@michael
7 years ago
7,746 posts
The reason its not showing is the loop variable is $row not $item. We normally use $item but for some reason this time $row is the variable, so change
<img src="{$item.youtube_artwork_url}" alt="{$item.youtube_title|jrCore_entity_string}"
to
<img src="{$row.youtube_artwork_url}" alt="{$row.youtube_title|jrCore_entity_string}"

then reset the caches and you'll be good to go.
mountaintop
@mountaintop
7 years ago
76 posts
Hi Michael,

Thank you it works :)

Helmut


--
jesan
FRC All Music
paul
@paul
7 years ago
4,331 posts
Sorry - that was my fault. I just copied/pasted the above code without checking it too closely :-(


--
Paul Asher - JR Developer and System Import Specialist