This code fixes the sub-issue i described in this post.

http://drupal.org/node/802412#comment-2983678

If no vimeo video had been selected , the default 'vimeo loading' moving would appear in the node. I would never want this in my page, so i've tweaked this function in vimeo.module to not output the field if a value hasn't been set for it.

It's the first time i've tweaked a module, so i'm not sure if this is the correct way to do it, but it works for me.

Cheers

M

/**
 * Theme function for 'default' vimeo field formatter.
 */
function theme_vimeo_formatter_default($element) {
  $data = vimeo_cache_video_get($element['#item']['value']);
  $video_id = $data['id'];
 
  if ($video_id)
  {
  return '<object width="'. variable_get('vimeo_width', 640) .'" height="'. variable_get('vimeo_height', 360) .'" class="vimeo-video">
  <param name="allowfullscreen" value="true" />
  <param name="allowscriptaccess" value="always" />
  <param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='.$data['id'].'&amp;server=vimeo.com&amp;show_title='. variable_get('vimeo_title', 1) .'&amp;show_byline='. variable_get('vimeo_byline', 1) .'&amp;show_portrait='. variable_get('vimeo_portrait', 1) .'&amp;color='. variable_get('vimeo_colour', '00ADEF') .'&amp;fullscreen='. variable_get('vimeo_fullscreen', 1) .'&amp;autoplay='. variable_get('vimeo_autoplay', 0) .'" />
  <embed src="http://vimeo.com/moogaloop.swf?clip_id='.$data['id'].'&amp;server=vimeo.com&amp;show_title='. variable_get('vimeo_title', 1) .'&amp;show_byline='. variable_get('vimeo_byline', 1) .'&amp;show_portrait='. variable_get('vimeo_portrait', 1) .'&amp;color='. variable_get('vimeo_colour', '00ADEF') .'&amp;fullscreen='. variable_get('vimeo_fullscreen', 1) .'&amp;autoplay='. variable_get('vimeo_autoplay', 0) .'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'. variable_get('vimeo_width', 640) .'" height="'. variable_get('vimeo_height', 360) .'"></embed>
  </object>';
  }
}

Comments

jdwfly’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not quite sure what you are fixing, but this section is going to be changing soon since the embed code has changed.

hixster’s picture

The embed code was being written out into the node even if you hadn't added a video to the field.

jdwfly’s picture

Title: This fixed the issue of the vimeo field being output when no movie has been set » Don't output anything if there is no video
Status: Postponed (maintainer needs more info) » Active

ok, there were a few other posts about this as well, but it will be fixed soon.

jdwfly’s picture

Status: Active » Fixed

fix committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.