我的swfobject_api或jwplayer模块有问题
当我在node.tpl.php中使用此代码时,一切都很好
$config='sample';
$flashVars=array( 'file' => 'path to flv' );
print theme('jwplayermodule_render_player', $config, $flashVars);
但是当我在front-page.tpl.php中使用此代码时,代码无效
在node-tpl.php中,此脚本返回
<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>
但是在front-page.tpl.php中没有返回
我将<?php print $closure ?>
放在footer.php中并将其包含在front-page.tpl.php和node.tpl.php
抱歉我的英文不好
答案 0 :(得分:1)
您的模板文件应该被称为page-front.tpl.php,而不是front-page.tpl.php。一旦你重命名它就刷新你的缓存,它会工作!