I am currently working on a custom index model that shows YouTube videos from the shops related channel. I have the code working outside of Phoenix but I'm looking at how to add it in.
I know how to duplicate the module and get that to show, what I'm struggling with is where to put the code for the function that fetches the videos - see below.
LeeFoster wrote: ↑Fri Aug 16, 2024 10:35 am
I know how to duplicate the module and get that to show, what I'm struggling with is where to put the code for the function that fetches the videos
Probably misunderstanding but does it not work with that function definition in the main module file and $videos variable then output in the tpl_ file?
LeeFoster wrote: ↑Fri Aug 16, 2024 10:35 am
I know how to duplicate the module and get that to show, what I'm struggling with is where to put the code for the function that fetches the videos
Probably misunderstanding but does it not work with that function definition in the main module file and $videos variable then output in the tpl_ file?
That was my thought too but it didn't work. I've since gotten the module to a point that it displays the boxes for the videos but not the videos themselves and gives the error
Notice: Undefined variable: videoId in includes\modules\pi\index\templates\tpl_i_youtube_videos.php on line 11
Last edited by LeeFoster on Sun Aug 18, 2024 8:07 pm, edited 2 times in total.
LeeFoster wrote: ↑Sun Aug 18, 2024 7:55 amUndefined variable: videoId in includes\modules\pi\index\templates\tpl_i_youtube_videos.php on line 11
Don't have an answer. Only guessing the video.id.videoId property might not be defined in the response from the YouTube API. Maybe the video is some type of content that doesn't have a videoId field.
heatherbell wrote: ↑Sun Aug 18, 2024 9:15 am
Don't have an answer. Only guessing the video.id.videoId property might not be defined in the response from the YouTube API. Maybe the video is some type of content that doesn't have a videoId field.
Strange thing is I had this working on it's own before I decided to add it to a Phoenix site.