Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have a problem with swfobject_api or jwplayer module.

When I use this code in node.tpl.php everything is fine.

$config='sample';
$flashVars=array( 'file' => 'path to flv' );
print theme('jwplayermodule_render_player', $config, $flashVars);

When I use this code in front-page.tpl.php the code is not working.

In node-tpl.php this JavaScript is added.

<script type="text/javascript" src="/projects/theme/sites/all/modules/drupal/jwplayermodule/jwplayermodule_jwembedder.js?c"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "jwplayer": { "files": { "jwplayer-1": { "flashplayer": "http://localhost/projects/theme/sites/default/files/jwplayermodule/player/player.swf", "width": "400", "height": "280", "controlbar": "bottom", "wmode": "opaque", "file": "/projects/theme/sites/default/files/1057680_0.flv", "config": "http://localhost/projects/theme/sites/default/files/jwplayermodule/configs/sample.xml", "events": [  ] } } } });
//--><!]]>
</script>

In front-page.tpl.php, it is not added.

I put <?php print $closure ?> in footer.php, and included it in front-page.tpl.php and node.tpl.php.

share|improve this question
    
what is output for front-page.tpl.php? nothing? if nothing are you sure front-page.tpl.php registered correctly? –  Mohammad Ali Akbari Sep 3 '11 at 20:38

1 Answer 1

Your template file should be called page-front.tpl.php, not front-page.tpl.php. Once you've renamed it flush your caches and it will work!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.