Templating
This page will guide you through the setup of your XHTML template so that Kreus CMS can understand it. This guide assumes you have successfully installed Kreus CMS on to your web server.
Page Template
Take your main page template and save it to /kreus/application/views/pages/page.tpl.php.
Head Tags
If you want to have editable keywords, add this to the head of the template:
<meta name="keywords" content="<?php echo $page['keywords'] ?>">
Links to images and style sheets are done like so:
<link rel="stylesheet" media="screen,projection" type="text/css" href="<?php echo WWW_DIR;?>/public/pages/css/style.css">
Finally the page title:
<title><?php echo $page['title']; ?></title>
Main Menu
Menu links are generated as an unordered list, add this in between your ul tags:
<?php foreach ($menu as $item) { ?>
<li><a href="<?php echo WWW_DIR.'/pages/'.$item['slug'] ?>"><?php echo $item['title'] ?></a></li>
<?php }; ?>
Contact Form is yet another menu item and thus we continue by adding this directive after the menu links:
<?php if (isset($contact_form)) { ?>
<li><a href="<?php echo WWW_DIR.'/pages/contact_form' ?>"><?php echo $contact_form['Contact Form'] ?></a></li>
<?php }; ?>
Main Content
Add the following code where you want to output the main content:
<?php echo $page['content_html']; ?>
Sidebar
Sidebar or Extra Content is output in much the same way as the main content:
<?php echo $page['sidebar_html']; ?>
Ajax
You might wish to add a a directive to your CSS that shows a spinning gif when Contact Form is being processed:
#form_result.ajax-loading{background:url(../img/spinner.gif) no-repeat left;padding:23px 0px 0px 22px;}