# page_api

The page API contains all API methods for creating and deleting Page Editor Pages                                                        (added in v3.3.0)

Methods: page__

create($data) - Used to create a new Page Editor Page

create(array $data) : array

Returns: (array)

['error'] - TRUE/FALSE - Error status of the create request

['error_msg'] - TEXT - Error message returned (if ['error'] = TRUE).

['pagesmain_id'] - INT - Numeric Page ID# of the newly created Page Editor Page.

Parameters:

$data (array)

Expects an array containing the following array keys:

$data['pagesmain_title'] - TEXT - REQUIRED - The Friendly Title of your Page, e.g.: "About us".

$data['pagesmain_full'] - TEXT - OPTIONAL - The HTML content (markup) to be used for the Page".

$data['pagesmain_published'] - INT - OPTIONAL - The numeric publish status of the Page. 0 = Draft  1= Live. Default value is: 0/Draft

$data['pagesmain_description'] TEXT - OPTIONAL - HTML Meta Description. A 160 character or less summary of the page contents.

$data['pagesmain_keywords'] TEXT - OPTIONAL - Comma delimited list of HTML Meta Keywords.

Example: Create a new Page that is status: Live. Insert the page's Title, HTML markup, Meta Description, and Keywords.

//Create a new Page

$result = $api->load_local_api('page__create',array(

'pagesmain_title' => 'Hello World!',

'pagesmain_full' => '<h1>Hello World!</h1>

<div>

Example: Coming Soon...

</div>',

'pagesmain_published' => 1,

'pagesmain_description' => 'My first "Hello World" page',

'pagesmain_keywords' => 'Hello, World, Example'

));

if($result['error']){

//If an error occurs die and show the error msg;

die($result['error_msg']);

}

// format and output the contents of the $result array so the keys

// and values can be seen.

echo '<pre>';

print_r($result);

echo '</pre>';

update($data) - Used to insert a Page Editor Page

update(array $data) : array

Returns: (array)

['error'] - TRUE/FALSE - Error status of the create request

['error_msg'] - TEXT - Error message returned (if ['error'] = TRUE).

['pagesmain_id'] - INT - Numeric page ID# of the newly created Page Editor Page.

Parameters:

$data (array)

Expects an array containing the following array keys:

$data['pagesmain_id'] - INT - REQUIRED - The numeric ID# of the Page Editor page to be deleted.

$data['pagesmain_title'] - TEXT - OPTIONAL - The Friendly Title of your Page, e.g.: "About us".

$data['pagesmain_full'] - TEXT - OPTIONAL - The HTML content (markup) to be used for the Page".

$data['pagesmain_published'] - INT - OPTIONAL - The numeric publish status of the Page. 0 = Draft  1= Live. Default value is: 0 (Draft).

$data['pagesmain_description'] TEXT - OPTIONAL - HTML Meta Description. A 160 character or less summary of the page contents.

$data['pagesmain_keywords'] TEXT - OPTIONAL - Comma delimited list of HTML Meta Keywords

$data['page_seotitle'] TEXT - OPTIONAL - Properly formatted SEO title to be used as the HTML Page Name. Should not contain spaces or special characters that are not URL encoded. Will be automatically generated if you change the 'pagesmain_title'.

Note: If you attempt to change the 'pagesmain_title'  and 'page_seotitle' at the same time, 'page_seotitle' will be ignored in favor of the new Page SEO title that was generated as a result of submitting a 'pagesmain_title' change.

Example: Update Page ID# 7

//Update an existing Page ID# 7

$result = $api->load_local_api('page__update',array(

'pagesmain_id' => 7,

'pagesmain_title' => 'Hello World! 2',

'pagesmain_full' => '<h1>Hello World\'s page! 2</h1>

<div>

Example: Coming Sooner...

</div>',

'pagesmain_published' => 1,

'pagesmain_description' => 'My first "Hello World" page take 2',

'pagesmain_keywords' => 'Hello, World, Example, Sooner',

'page_seotitle' => 'this seo title will be replaced anyway',

));

if($result['error']){

//If an error occurs die and show the error msg;

die($result['error_msg']);

}

// format and output the contents of the $result array so the keys

// and values can be seen.

echo '<pre>';

print_r($result);

echo '</pre>'; = $api->load_local_api('page__update',array(

delete($data) - Used to delete a Page Editor Page

delete(array $data) : array

Returns: (array)

['error'] - TRUE/FALSE - Error status of the create request

['error_msg'] - TEXT - Error message returned (if ['error'] = TRUE).

['pagesmain_id'] - INT - Numeric page ID# of the newly created lPage Editor Page.

Parameters:

$data (array)

Expects an array containing the following array keys:

$data['pagesmain_id'] - INT - REQUIRED - The numeric ID# of the Page Editor page to be deleted.

Example: Delete Page ID# 7

//Delete Page #7

$result = $api->load_local_api('page__delete',array(

'pagesmain_id'=> 7

));

if($result['error']){

//If an error occurs die and show the error msg;

die($result['error_msg']);

}

// format and output the contents of the $result array so the keys

// and values can be seen.

echo '<pre>';

print_r($result);

echo '</pre>';