getContent()

Pixelsilk API function to get the unparsed content of a section (page) by its path relative to the root--used by the content editor--this is the main content of the section (page)
Parameters:
path: the path of the section(page) relative to the root

Output:
The getContent function returns a string containing the content.

C# Example:
string content = GetContent(path);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/getContent HTTP/1.1
HOST: www.example.com
Content-Length: 92
Content-Type: application/x-www-form-urlencoded
Cookie: auth=F262538C21AA...FB248B9A6541

Request Data:
Unencoded Data:
json={
   "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=A5500CE849FC...6BB16A08E2D; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 20

Response Data:
"test\u003cbr\u003e"

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

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

Returned Data:
"This is the content of test."

Back to Content »