我需要一个带有embed
的Youtube缩略图列表。我已经有了Tubepress,我正在尝试将它与Prestashop的Smarty模板集成,但是出了点问题。
我在tpl中有一个初始化且正确的变量:
{$searchvideo = $product->name|escape:'htmlall':'UTF-8'}
{searchvid}
$searchvideo
是产品名称的字符串。 searchvid
从function.searchvid.php
进入Prestashop的插件目录。
function.searchvid.php
:
<?php
function smarty_function_searchvid($params, $template) {
$tubepress_base_url = "http://domain.com/folder/tubepress_pro_2_2_9";
include "/home/folder/www/tubepress_pro_2_2_9/sys/classes/TubePressPro.class.php";
$searchvideo = $template->getTemplateVars("searchvideo");
print TubePressPro::getHtmlForHead(true);
print TubePressPro::getHtmlForShortcode('mode="tag" tagValue="intitle:'. $searchvideo .'" thumbHeight="100" thumbWidth="100" embeddedHeight="325" embeddedWidth="534" embeddableOnly="true" resultsPerPage="5"');
}
?>
问题是,即使在我调用{searchvid}
之后页面也没有加载任何内容。任何帮助将不胜感激。
答案 0 :(得分:0)
插件函数应该返回它的字符串,而不是打印它。你试过吗?那个女管家甚至装好了吗?