Strumelia:....
"If you know the youtube video you want, you can just ask for it"
-Maybe he's trying to always have the LATEST video from a particular user showing somewhere on his site aside from on their profile- as opposed to embedding one certain video from that user? He did mention 'latest video'.....
Yup, nice one, you're onto it
. But before we can jump to the complex we first need to get the simple working.
In order to make that code I posted above show the latest video all that needs doing is to replace the
31 with the variable that contains the number of the latest video.
Ah, but how do we get that........ A: It depends on where we are. Maybe that info is available in the {debug} like
@paul suggested, but it only will be if we're in some sort of {jrCore_list} like
@ultrajam suggested.
Now that we know the full question:
"I'm trying to have the latest imported youtube video from the users profile embedded in the profile_index."
We need to add in a way to get the latest video's item_id
{capture assign="template"}
{literal}
{if isset($_items) && is_array($_items)}
{foreach $_items as $item}
{jrYouTube_embed type="iframe" item_id=$item._item_id auto_play=false width="100%"}
{/foreach}
{/if}
{/literal}
{/capture}
{jrCore_list module="jrYouTube" order_by="_created desc" search1="profile_id = $profile_id" template=$template limit=1}
The {capture} in the code is to avoid having to add another file to the file system, there are docs on it here:
Docs: "HowTo: use {capture} to avoid using another file for {jrCore_list} calls"
https://www.jamroom.net/the-jamroom-network/documentation/jamroom-developers-guide/1637/howto-use-capture-to-avoid-using-another-file-for-jrcore-list-calls