Hello,
I have a content type where the article author can insert a youtube video link. In the teaser view i want to extract the from the link the video code and render the image only. Let say my video url field is called : "field_url_vid" (text field).
My youtube link is http://www.youtube.com/watch?v=XYZZZ. In this case i want to introduce a function in template.php that alters the output :
str_replace ('http://www.youtube.com/watch?v=', '', $field_url_vid');
to keep only the code.
I have been looking around and followed tutorials but all of them explain the way to alter existing preprocessing/processing functions. I did not get any explanation on how to use them for custom cck field.
Thanks in advance for any suggestion

Comments

nevets’s picture

If you use one of the youtube modules they often have a formatter that supports showing just the image.

yazzou’s picture

Thanks nevets
But i would be very curious to see how to overide a custom cck field with template.php file !

nevets’s picture

If it's a custom field, the proper approach would be to write a formatter for the field that only shows the image.