renderSkin()

Pixelsilk API function to render a simple skin
Parameters:
skin: the skin to be rendered
path: the path to the page relative to the root

Output:
The function renderSkin returns a string containing the rendered skin. This string may then be used as desired in the page of choice.

C# Example:
string skin = skinString;
string path = pagePath;
string renderedSkin = RenderSkin(skin, path);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/renderSkin HTTP/1.1
HOST: www.example.com
Content-Length: 139
Content-Type: application/x-www-form-urlencoded
Cookie: auth=1920E69F1E18...7463D2E202F7

Request Data:
Unencoded Data:
json={
   "skin":"",
   "path":"/test/"
}&token=7AdbNHZQBtwc...RPTEK8UvSUQ=

Url-encoded Data:
json=%7b%0d%0a+++...%22%0d%0a%7d&token=7AdbNHZQBtwc...TEK8UvSUQ%3d

Response Headers:
HTTP/1.1 200 OK
Set-Cookie: auth=603D325B4D75...23D10E205B2; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 152

Response Data:
"\u003ca href=\"http://www.example.com\"\u003eHome\u003c/a\u003e -\u003e \u003ca href=\"http://www.example.com/test/\"\u003etest\u003c/a\u003e"

This output is actually a sequence of links:
Home -> test

JavaScript Example:
Method Call:
pixelsilk2.renderSkin(input, callback);

Input Object:
{
    skin:"",
    path:"/TestList/test/"
}

Returned Data:
<a href=\"http://localhost/PixelSilk/\">Home</a> ->
<a href=\"http://localhost/PixelSilk/TestList/\">TestList</a> ->
<a href=\"http://localhost/PixelSilk/TestList/test/\">test</a>

Back to Skins »