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:

<?php
/**
 * [PHPFOX_HEADER]
 */

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:
module/core/template/default/controller

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.

Comments
Only verified clients can post comments on our community. If you have any questions feel free to contact us here.
data66 wrote at March 5, 2011, 8:26 pm
0 Votes

This needs to be updated to work with 2.07 build 4. It works fine for older versions though as I used it to make a page before upgrading to build 4.

data66
data66 wrote at February 20, 2011, 11:00 pm
0 Votes

Is there a typo in this?

* Class process method wnich is used to execute this component.

data66
VBT wrote at February 20, 2011, 11:12 pm
0 Votes

Looks like there is but it's rem'd out

VBT
jstcureus wrote at January 22, 2011, 9:34 pm
1 Vote

When I follow these directions I get "The page you are looking for cannot be found".

I checked everything twice.

Please advise.

Thanks

jstcureus
Purefan wrote at November 5, 2010, 1:50 pm
1 Vote

If you want a more customized way you can also create a new folder in /module/ with the name of your site, for example:
/module/phpfoxcom/ and put your files in there:
/module/phpfoxcom/template/default/controller/
and
/module/phpfoxcom/include/component/controller/

Separates the core script from your own additions.

Purefan
Jawfull wrote at February 25, 2011, 1:03 pm
0 Votes

Hi. Thanks
i have create the page. Now how to use it as my homepage?
Also can I make my own page design by adding html or php code?

Jawfull