Convert action_data to item

nate
@nate
8 years ago
917 posts
I wanna show media in my timeline. Current I have to query the item. This isn't ideal.

How do i convert the action_data to an item that cant be used with item features like players, comments and likes?

updated by @nate: 07/06/16 10:55:36AM
paul
@paul
8 years ago
4,326 posts
It depends on the template so put in a {debug} to see what the sub-array is, then use that. For instance, in the jrAudio item_action.tpl template its in $item.action_data so a player might look like this -

{jrCore_media_player type=$player module="jrAudio" field="audio_file" item=$item.action_data}

In the jrAction item_list.tpl template it'll be $item.action_item
hth


--
Paul Asher - JR Developer and System Import Specialist
nate
@nate
8 years ago
917 posts
That returned this
Quote: {jrCore_media_player} no media found for player (skins/n8Maestro4/jrAudio_item_action.tpl) - See more at: http://n8flex.com/pop-culture#sthash.yPQjQIok.dpuf

I suppose I could to write the long hand version for the player code.

What I really wasn't is to have timeline comments go the the media instead of the action. So if they like a song the song gets the new comment. I have to pass an item to get it to work tho.
updated by @nate: 03/31/16 12:19:19PM
nate
@nate
8 years ago
917 posts
So I got the player to show, but the action is created before the files are converted. So, the media files are not in the action_data. This is why I have been running a query.

I can handle the player but not item_detail_features.
nate
@nate
8 years ago
917 posts
Quote: {jrCore_item_detail_features} invalid value received for "item" parameter (skins/n8Maestro4/jrAction_item_list.tpl)
nate
@nate
8 years ago
917 posts
I suppose I can try loading the item_features individually but I'd still need the item, correct?
nate
@nate
8 years ago
917 posts
For the record, this doesn't work for audio and video. The action is created too early for the media data and is never updated.

You can close this out now.
michael
@michael
8 years ago
7,715 posts
maybe use:

Docs: "Defining your own smarty function"
https://www.jamroom.net/the-jamroom-network/documentation/development/1569/defining-your-own-smarty-function

and pass in whatever you have from the action and manipulate it server side then return whatever you want back to the timeline.
nate
@nate
8 years ago
917 posts
I am not using item_detail_features. Instead I am using {jrComment_form} And I already made my own like bar.

Thanks.

Tags