Does anyone know if there is a Drupal module which allows you to add animated page headings (flash or javascript) through Drupal?

Thanks
Dan

Comments

ñull’s picture

I made a Flash animation and dinamically took information from Drupal to display: a different banner image would fade in using taxonomy_image and the title would move in with some simple animation. This was still based on 4.6.x and the XTemplate. I needed to change xtemplate.engine:

Added the variable in the xtemplate_page function:

"head_text" =>  urlencode((drupal_get_title() ? strip_tags(drupal_get_title())  : variable_get("site_slogan", ""))),

Then further down in the same function I seem to have added this:

 if ($title = drupal_get_title()) {
   if (module_exist("taxonomy_image") ) {
	 if (arg(0)=='taxonomy' && arg(1)=='term')
	 {
	  $images[] = taxonomy_image_display(arg(2));
	 }
	 elseif (arg(0)=='taxonomy_menu')
	 {
	  $argcntr=0;
	  while ( arg( ++$argcntr ) );
	  $images[]=taxonomy_image_display(arg($argcntr-1));
	 }
	 elseif (arg(0)=='node')
	 { 
 // I don't need images of all terms, only the first.  
 //     foreach (taxonomy_node_get_terms(arg(1)) as $term) 
 //       $images[] = taxonomy_image_display($term->tid,"alt='$term->name'");
      $terms=taxonomy_node_get_terms(arg(1));
      $term=current($terms);	  
      $images[] = taxonomy_image_display($term->tid,"alt='$term->name'");
	 }
    }

In the theme I used this code to communicate with the flash animation:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="754" height="107">
          <param name="allowScriptAccess" value="sameDomain" />
          <param name="movie" value="/themes/p4a/header.swf" />
          <param name="quality" value="high" />
          
          <param name="FlashVars" value="ImageHTML={taximg}&passText={head_text}" />
          <param name="LOOP" value="false" /><param name="SCALE" value="exactfit" /><param name="BGCOLOR" value="#F4F3EF" />
          <embed src="/themes/p4a/header.swf" width="754" height="107" loop="false" scale="exactfit" quality="high" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="ImageHTML={taximg}&passText={head_text}" bgcolor="#F4F3EF" />        
</object> 

Of course you have to know how to use these variables in Flash to show the picture and title.

Soon I would need to redo all this for 4.7.x and PHPTemplate engine and I would share it with you how I did it, if you are patient enough to wait.