Drupal 中的 swfobject_api 或 jwplayer 模块出现问题
我的 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 中此脚本是 return
<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 中未返回,
我将 放在 footer.php 中并将其包含在 front-page.tpl.php 中node.tpl.php
抱歉我的英语不好
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);
But when i use this code in front-page.tpl.php the code is not working
In node-tpl.php this script is return
<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>
But in front-page.tpl.php not returned
I put <?php print $closure ?>
in footer.php and include it in front-page.tpl.php and node.tpl.php
sorry for my bad English
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的模板文件应命名为 page-front.tpl.php,而不是 front-page.tpl.php。一旦你重命名它,刷新你的缓存,它就会工作了!
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!