PAGE Methods

compile()

This function compiles a complete page or parts thereof and returns the page's contents. It's a way of manually getting the content for an ajax call. It produces a similar result to the one fetched via the collect() method, the main difference being that all additional code added by the script() or style() methods will be omitted. So when using this method to show content make sure that all your CSS code and JS code is in place.

string compile( int index [, string area [, string view ]])

Return

Page's complete content or parts thereof

Parameter
Description
indexBackend's navigation index
areaPass this parameter if you want to get the content of a specific area only. Areas are defined in the backend's template section.
viewGet only content of those elements that have been assigned this view. Views are defined in the backend's template section and are assigned to a content-element in the navigation's content section.

Get complete content of a page

$PAGE->compile(183)
RETURN: ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-en" lang="en-en" > <head><link href="https://fonts.googleapis.com/ic ...

Get AREA named "content" of a page

$PAGE->compile(183, 'content')
RETURN: ' <div class="left full element756 pagetext first"> <div class="left full html"><h2>Reserved Keywords</h2><p>Please note that there are a few reserved keywords that we ask you not to use in your own code.</p> </div> </div><div class="matrix ...

Get AREA named "content" for which the VIEW named "attention" has been selected

$PAGE->compile(183, 'content', 'attention')
RETURN: ' <div class="left full element757 pagetext attention"> <div class="left full html"><p>Do not overwrite the names of our <a href="/api">API objects</a> or shortcuts. Overwriting any of the objects provided won't cause any errors as such, however, ...