There several ways to create custom pages, here are 2 different approaches:
- Create a CMS page (with the "central_block") and add the content into a custom block, so you can output whatever you like by creating a proper function. Just duplicate a block, and add in the function your content, something like this:
<?php
/**
*
* @package Icy Phoenix
* @version $Id$
* @copyright (c) 2008 Icy Phoenix
* @license http://opensource.org/licenses/GPL-license.php GNU Public License
*
*/
if (!defined('IN_ICYPHOENIX'))
{
die('Hacking attempt');
}
if(!function_exists('cms_block_myblock'))
{
function cms_block_myblock()
{
global $db, $cache, $config, $template, $theme, $images, $user, $lang, $table_prefix, $block_id, $cms_config_vars, $cms_config_layouts, $cms_page;
$mycontent = '<b>My Fantastic Page</b>';
$template->assign_vars(array(
'MYCONTENT' => $mycontent,
)
);
}
}
cms_block_myblock();
?>
Then you just need to create a tpl called myblock_block.tpl in templates/default/blocks/ with this content:
Then just add the block to the page and you are done.
- As a second option you can create an empty PHP page like this:
<?php
/**
*
* @package Icy Phoenix
* @version $Id$
* @copyright (c) 2008 Icy Phoenix
* @license http://opensource.org/licenses/GPL-license.php GNU Public License
*
*/
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
$cms_page['page_id'] = 'mypage';
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
// End session management
$mycontent = '<b>My Fantastic Page</b>';
$template->assign_vars(array(
'MYCONTENT' => $mycontent
)
);
full_page_generation('mycontent_body.tpl', $lang['MYCONTENT'], '', '');
?>
Then you just need to create a tpl called mycontent_body.tpl in templates/default/ with this content:
<!-- INCLUDE overall_header.tpl -->
{MYCONTENT}
<!-- INCLUDE overall_footer.tpl -->
Then in CMS => Standard Pages create the new page so you can add blocks and specify other features:
Enjoy your newly created pages! :mri: