How to add parameters
Parameters are added to the <fsi-pages>
tag. Note that you can as well use FSI Pages configuration files:
Adding Parameters to FSI Pages
Example:
<head>
//adding the fsipages.js script
<script src="//yourdomain.com/fsi/viewer/applications/pages/js/fsipages.js" type="text/javascript"></script>
</head>
<body>
//Adding parameters directly to the tag:
<fsi-pages width="500" height="600" dir="/images/catalog/" debug="true" skin="silver" PageLayout="flip"></fsi-pages>
//Example with using a FSI Pages configuration file:
<fsi-pages width="500" height="600" dir="/images/catalog/" cfg="sample/catalog.xml"></fsi-pages>
</body>
Simple Configuration File
You can also define individual configuration .xml
files like this:
Example:
<fsi_parameter>
<image>
<path value="samples/Watch.jpg" />
</image>
<Pages>
<skin value="silver" />
<debug value="1" />
<pagelayout value="flip" />
<thumbsize value="100" />
<bendeffect value="none" />
</Pages>
</fsi_parameter>
Defining Global Parameters
If you would like to use global parameters for all FSI Pages instances,
the corresponding parameters can be defined in the _default.xml
.
Example:
<fsi_parameter>
<Image>
<ServerType value="FSI"/>
</Image>
<Pages>
<skin value="silver" />
<debug value="1" />
<pagelayout value="flip" />
<thumbsize value="100" />
<bendeffect value="none" />
</Pages>
<Options>
<FSIBase value="config/"/>
<Language value="english"/>
<ScenePreload value="true"/>
</Options>
</fsi_parameter>
Passing Parameters to the script
You can optionally modify the way FSI Pages works by passing parameters to the script. To do so, pass an object containing the parameters and value as an object to the constructor:
Example:
var node = document.createElement("fsi-pages");
node.style.width = "600px";
node.style.height = "400px";
var parameters = {"dir" : "images/mycatalog/", "skin":"silver", "debug":true};
$FSI.setParameters(node, parameters);
document.body.appendChild(node);
// Important: call this AFTER adding the node to the DOM
$FSI.initCustomNode(node);