« HS-CMS documentation home

Fragments and Inclusion

A page with a format of php may include the contents of another file like this:

//Optionally start with the URI of the page you want to include:
$uri = 'about';
$page = HS_Core::identify_page($uri);

//Then actually render the page  (or start at this step, 
//if $page is already the ID of the page you want to include).
HS_Core::render_page($page,'',0);

The last agument of HS_Core::render_page can be 1 to force an <h1> to be rendered, 0 to not force it either way (rendered only if it is in the content, not just the meta data), or -1 to force it to be excluded.

Including pages in this manner works recursively, too.

In the future we hope to support a syntax that allows all page formats to include other pages.