0

我正在尝试探索 STS 模板系统。

我需要做的很简单。

我只想在从 OSC 管理员添加的右栏中显示一个横幅/框。

我已完成以下步骤:

  1. 添加了来自管理员横幅管理器的横幅。
  2. 在名为 customBanner.php 的包含/框目录中创建了一个文件
  3. 在 column_right.php 中添加了这一行 include(DIR_WS_BOXES . 'customBanner.php');
  4. 最后将以下代码添加到 customBanner.php

<?php
if ($banner = tep_banner_exists('dynamic', '170x158')) {
?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
</tr>
</table>
<?php
}
?>

此代码基本上用于没有 STS 模板的 OSC。

现在我需要知道 STS 模板如何在 php.html 文件中提供输出,例如<td>$specialbox</td>。我的意思是这个变量是如何从 sts 中获取价值的。以及如何在右栏中显示广告框。

4

2 回答 2

0

您应该将以下代码添加到 includes/modules/sts_inc/sts_user_code.php 中:

$sts->start_capture();
include(DIR_WS_INCLUDES . 'boxes/customBanner.php');
$sts->stop_capture('specialbox');

也可以使用您自己的文件来添加此代码,但您应该将其名称包含在 admin->modules-> Default -> Files for normal template

于 2011-05-20T20:48:23.717 回答
0

您可以以相同的方式添加任意数量的框:

$sts->start_capture();
include(DIR_WS_INCLUDES . 'boxes/customBanner.php');
$sts->stop_capture('box1');

$sts->start_capture();
include(DIR_WS_INCLUDES . 'boxes/OTHERcustomBanner.php');
$sts->stop_capture('box2');
于 2011-11-02T11:02:49.830 回答