Copyright by Propagator.net , Author: Joey Wong [Huang JunYan] Version: 1.0



3.2 SlideCrab tags for Smarty Engine.

SlideCrab fully supports Smarty template engine. SlideCrab has own tags for Smarty,it's one pair of container tags,look like {slidecrab}{/slidecrab}. You just need to put them into your template files to contain image HTML tags which want to show and protect.

Here's a simple example.You will understand SlideCrab powerful function.

 Template File: mysite.html
  <html>
<head>
<meta http-equiv="Content-Type" content="text/html;>
<title>Propagator's SlideCrab Sample (Work with Smarty Template)</title>
</head>

<body>
<div align="center">
{slidecrab name="test" width="400" height="300"}
<a href="http://www.propagator.net"><img src="images/sample01.jpg" width="400" height="300" alt="01"></a><br>
<img src="images/sample02.jpg" width="400" height="300" alt="02"><br>
<img src="images/sample03.jpg" width="400" height="300" alt="03"><br>
<img src="images/sample04.jpg" width="400" height="300" alt="04" resize="1"><br/>
{/slidecrab}
</div>
</body>
</html>

 


 Main File: mysite.php
  <?php
session_start();

require_once("smarty/Smarty.class.php");
require_once("slidecrab/slidecrab.class.php");

$smarty = new Smarty;
$smarty->display("mysite.html");

?>


Voila.It's really simple and incredible,right?

SlideCrab will capture all required attributes from <IMG> HTML tags and <A> HTML tags which contain <IMG> to generate slide show rotation. It can capture your image's linkage from <A> tags and image's URL,alternate text,resize setting from <IMG> tags. Please see the following picture:




From the sample.we discovered that template files has no modify in a big way.No flash embeded codes,nothing extra except SlideCrab tags.They
won't affect original HTML result.So your web designer still can keep going on this template file in any WYSIWYG HTML editor.such as Dreamweaver, FrontPage.It's a great revolution.Propagator always cares about designing layout.

Tips: You can set your default configuration in slidecrab.conf.php(Please see 2.1 Configuration) , and just put{slidecrab}{/slidecrab} tags to your templates,let's work automatically.

Notice: IF you have more than one slide show set in a page, you have to assign different name attribute for each pair of slidecrab tags.



<Prev
what is Smarty
Next>
SlideCrab tags attributes