Community Documentation

v3 Knowledgebase

Create a Page

This tutorial will expain how to create a page without using admincp.

And you may ask: but if I can use admincp to create a page why should I use this?

For me one of the main reasons to use this is that your page will have their own identity. If we create a page in admincp and then add blocks to it, you only have the page.view to use, and this means that the block you add will be shown, not only in that page, but in all pages created in admincp.

By using this you can add blocks only to this page. This is a good option to create a new home page to show the blocks that only visitors see, for example.

So, the first step is to add a new component in admincp

Go to extension>module>add component

Select Core for module
write the name of the page
and add the url that should look like this: core.pagename

select crontroller as type and save.

Now you must add to this directory: module/core/include/component/controller

the file named pagename.class.php with the code:


defined('PHPFOX') or exit('NO DICE!');

 * @copyright		[PHPFOX_COPYRIGHT]
 * @author  		Raymond Benc
 * @package 		Phpfox_Component
 * @version 		$Id: index.class.php 604 2009-05-29 21:28:02Z Raymond_Benc $
class Core_Component_Controller_pagename extends Phpfox_Component 
	 * Class process method wnich is used to execute this component.
		public function process()

Don't forget to replace the pagename with the name of your page.

Next you must add to this directory:

the file named pagename.html.php

Leave it blank if you want to use this page to add blocks only, or write the content of it.

Now you have a new page that you can add to the menu.