https://www.icyphoenix.com/viewtopic.php?f=4&t=6372&p=43479#p43479
-----------------------------------
DWho
Thu 27 Aug, 2009 13:23

CMS - Standard Pages In CMS
-----------------------------------
Standard pages in icy 1.3 works differently than before in icy1.2.. you no longer add new pages this way but instead use the cms pages option in your cms pages...

Standard pages works by allowing you to add blocks to new pages you create or mods you have added...

for example I have installed a mod to my site  called test mod... in that mod there is a page called test.php.. when i open that page in my site I see a normal page with no blocks...

I have global blocks activated on all my site pages and I want to add global blocks to this page...

Go to ACP and click on the cms link in the top right hand corner. [img]http://www.icyphoenix.com/files/images/166/cms_link.png[/img]




after clicking here you will see the main cms page it look like the example below.

 [img]http://www.icyphoenix.com/files/images/166/standard_pages_link.png[/img] 




click on the standard Pages link and it will take you to the main stand links page as the example shows...

 [img]http://www.icyphoenix.com/files/images/166/standard_pages.png[/img]



here you can save changes quickly by ticking the boxes for global blocks or breadcrumbs the just click on the [b]save changes[/b] button at the bottom of the page..


to add blocks to new pages click on the add Site Page box at the bottom of the page this takes you too a new page as shown below...

 [img]http://www.icyphoenix.com/files/images/166/new_page_1251370952_767000.png[/img]  

here you add the details of the page you wish to have blocks or breadcrumbs showing...

for example:

[b]Name:[/b]  here write the name of the page so you remember it later... i will call mine [b]Test Page[/b]

[b]Page ID
This is the Page ID used by the auth system. Chars allowed: lower-case alpha, numbers, underscore, no spaces.[/b]

this does not have to be complicated but you need to remember it for later use... i am going to call it test_mod remember the underscore when there is a space between words... 

[b]Filename[/b] this is the name of the php file so our example here is [b]test.php[/b]

[b]show global blocks[/b]  click  on the radio button to add global blocks to this page so hit [b]yes[/b]

[b]Page Navigation Block (Breadcrumbs)[/b] if you wish to show standard icy breadcrumbs to you page then click on yes.. i do not for my example so i am leaving it as no..

[b]View permissions[/b] this basically allows you set the page to who you wish to see it so for now I have left it to all meaning everyone..

Here is the finished result in the image below.

 [img]http://www.icyphoenix.com/files/images/166/saved_new_page.png[/img]

now click on the submit button at the bottom of the page to store the data in your database...

you will see the new page added as the example below.

 [img]http://www.icyphoenix.com/files/images/166/new_page_added.png[/img] 

one thing left to do before adding blocks to this page and for it to work...

you need to open the php file you used in setting up the standard page  mine is [b]test.php[/b]

[b][color=darkred][size=14]please remember to back up this page first in case there is any mistakes...[/size][/color][/b]

look for this in that page

[code linenumbers=false]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);
include_once(IP_ROOT_PATH . 'includes/functions_groups.' . PHP_EXT);[/code]

and directly afterwards add

[code linenumbers=false]$cms_page_id = 'test_mod';
$cms_page_nav = (!empty($cms_config_layouts[$cms_page_id]['page_nav']) ? true : false);
$cms_global_blocks = (!empty($cms_config_layouts[$cms_page_id]['global_blocks']) ? true : false);
$cms_auth_level = (isset($cms_config_layouts[$cms_page_id]['view']) ? $cms_config_layouts[$cms_page_id]['view'] : AUTH_ALL);
check_page_auth($cms_page_id, $cms_auth_level);[/code]

now in that code you need to find... 

[code linenumbers=false]test_mod[/code]

and change it to the page id that you picked when you set up the new standard page...

save the file and upload it to your site...

now you can add blocks wherever you like on this page just as you would on a normal cms page.

 I hope this helps

 :mrgreen:  :mrgreen:


