I have just successfully installed the revised Video Module, which allows for six custom fields to be added to an uploaded video.

I would now like to theme the new video node and make one of the custom fields an image field so that one sees a static thumbnail jpeg before watching the video clip.

The module wraps the six custom textfields in a div with a class of "videofields" and each separate line is given a class of either "odd" or "even".

I'm a little confused about how to proceed: do I want to enter the path to the image in one of the text fields (and therefore write it into the database table) and then figure out a way to alter the underlying html elments to make what was formerly a line of text now a jpeg? (I presume this would be done by playing around with the module's PHP code and writing out something like img src="path to image.."

Or do I want to go down the path of creating a page called node-video.tpl.php as outlined here? Do I need to incorporate the image module somehow? It would be nice to have a way to upload still images through a browser, but I'd be happy enough just to be able to upload manually and hardwire in the pathnames.

I'm conceptually stuck, but in seeing that the contributor to the video module has done just this on his site I'm hoping there is a relatively straightforward way to do this.

Thanks in advance for any tips offered,

Barnaby

Comments

iraszl’s picture

I think it's done manually. You take a screenshot from the video and link it in the body text field.

---
http://creativebits.org

B-Dot’s picture

Thanks very much iraszl...it never even occurred to me to try using the body text field. I had to use the "full" html option in order to use the img tag...

This has solved my immediate need for sure, but I suspect that there might be a way of doing this that allows for greater control and more powerful layout options, specifically styling the image to add a border and so forth. It would seem to me that I could paste the appropriate inline CSS along with the img src, but that seems a little inefficient.

For instance, if I wanted to style all images pasted in in a consistent way, how would I first assign them to a CSS class? And how would I be able specify that the image be presented at 160 x 120 when it is promoted to a front page teaser instead of at a larger on the main video node page? (As occurs on Luke's parallel pixel site).

I feel I am close to having a breakthrough on custom node themeing but am still missing a few pieces of the puzzle.

iraszl’s picture

Sorry, I don't know, but I'd like to know that myself, so if you do figure it out, pls. let me know!
---
http://creativebits.org

LukeLast’s picture

It seems like you've already figured most of it out.

The div tags to theme are: all custom fields are in "videofields" tags, the title is in a "title" tag, and each field is in an "odd" or "even" tag. I realize now that the odd and even tags were a bad idea because the order is hardcoded so if a field is left empty it will mess up the order. Maybe I should change it to "field1", "field2", etc. I'm open to suggestions.

As for the images, you can put something like <img src="/path" /> code in any of the custom fields if you set the node filter to something like the full HTML option.
As for my site I use some PHP code in the nodes.
I actually plan to start working on a full image solution for the module, if Fax8 allows it then it'll be included in the module, otherwise it will be a patch or seperate module.

fax8’s picture

we are planning support for video screenshot and other features
for the next video.module for drupal 4.7 ..

So if anyone what to help us just contact one of the video module
developers...

Fabio