0

我需要一个 Youtube 缩略图列表embed。我已经有了 Tubepress,我正在尝试将它与 Prestashop 的 Smarty 模板集成,但出现了问题。

我在 tpl 中有一个已初始化且正确的变量:

{$searchvideo = $product->name|escape:'htmlall':'UTF-8'} 
{searchvid} 

$searchvideo是产品名称的字符串。searchvid来自 function.searchvid.phpPrestashop 的插件目录。

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}. 任何帮助,将不胜感激。

4

1 回答 1

0

插件函数应该返回它的字符串,而不是打印它。你试过吗?那个tubepress类甚至可以正确加载吗?

于 2012-03-02T18:19:34.410 回答