0

我实际上是在http://virtuemart.net/documentation/Developer_Manual/Modifying_the_Layout.html这个页面的帮助下自定义产品详细信息页面。我需要包含一些外部和内部 JavaScript。但不知道要添加脚本。请有人帮我做这件事。

修改产品详情页面。我刚刚在以下文件components/com_virtuemart/themes/default/templates/product_details/flypage.tbl.php 工作

Virtuemart 版本是VirtueMart 1.1.9 稳定版

Joomla 版本是Joomla!1.5.15 稳定

提前致谢。

4

1 回答 1

0

Based on your responses in the comments here is the answer:

//This line defines what JavaScript file you wish to add, change it as needed.
$myJsFile = JURI::Base() . 'templates/my_template_name/js/myJsFile.js';

//this line fetchs the jdocument object which is needed to add items to the head (amongst other things)
$document =& JFactory::getDocument(); //Drop the & if PHP5

//This line adds the previously setup JS url
$document->addScript($myJsFile);

If you want to add or something custom like IE conditional tags then see here for more info: http://docs.joomla.org/Adding_JavaScript_and_CSS_to_the_page on how to use this object.

于 2011-08-22T21:49:42.773 回答