开发者

OSCommerce STS template flow-How to get output of a box in html file

I am trying to explore STS template system.

What i need to do is simple.

I just want to 开发者_Go百科show a banner/box in the right column which is added from the OSC admin.

I have done the following steps:

  1. added a banner from admin banner manager.

  2. created a file in the includes/boxes directory under name customBanner.php

  3. added this line in column_right.php include(DIR_WS_BOXES . 'customBanner.php');

  4. And finally added the following code to 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
}
?>

This code is basically used for OSC without STS template.

Now i need to know how STS template giving output in php.html files e.g.<td>$specialbox</td>. I mean how this variable is getting value from the sts. and how can i show advertisement box in the right column.


You should add to the includes/modules/sts_inc/sts_user_code.php teh following code:

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

It also posible to use your own file to add this code but you should include its name in the admin->modules-> Default -> Files for normal template


You could add as many boxes as you like in the same way:

$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');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜