How to access video properties outside of Views fields?

Grantovich - June 16, 2008 - 21:30
Project:OpenPackage Video
Version:5.x-3.9
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:jbrown
Status:closed
Description

When I go into the Views interface, I can see that a lot of information is stored about videos, like number of views, number of completed views, duration, number of downloads, length, file size, etc. However, I can't seem to find a way to access this information in other places. As an example, I'm currently using Panels to format the page that a video is shown on, and I wanted to have the number of views display in one of the panels, but I just couldn't figure out how to get to it. Elsewhere, I was stymied in my efforts to create a "Most viewed videos" listing when I realized that none of the aforementioned video properties are available in the Sort Criteria for a view. I attempted to create a "fake" CCK field (via Computed Field) to pull in this data, but failed because I had no idea what variables I was supposed to use, and couldn't find any documentation regarding this. How do I get to this useful data outside of a Views field?

#1

jbrown - June 17, 2008 - 16:16

Information on each video is also exposed via the token module. You should try using token with panels.

You are correct about the sort criteria. It hasn't been implemented. I'll do this soon.

#2

Grantovich - June 17, 2008 - 21:46

Thanks for the advice about tokens. However, I can't seem to find a way to use them in conjunction with Panels. Maybe this is because 50% of Panels goes right over my head; I tried creating some "custom content", but found that tokens weren't parsed in it. Could you elaborate on your suggestion? Or if that turns out to be impractical, perhaps I could use a PHP snippet in a panel?

EDIT: I'd also like to find out how I can access video properties from a content template. They don't appear to be anywhere in the list of variables.

#3

Grantovich - June 23, 2008 - 15:48
Version:5.x-3.7» 5.x-3.9

Still waiting for an answer on this...

#4

jbrown - June 23, 2008 - 17:15
Assigned to:Anonymous» jbrown

I've just released 5.x-3.10 . All fields are now available in View's Sort Criteria.

You can do this sort of thing in contemplate:

print token_replace('[field_video-duration]', 'node', $node);

Its really weird that contemplate doesn't support Token directly.

You can put a View in a panel.

#5

Grantovich - June 23, 2008 - 18:09

Awesome, thanks for the new version! That token_replace trick will be useful in other places as well.

#6

jbrown - June 29, 2008 - 17:31
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.