|
Page 1 of 2
|
Mighty Gorgon
Luca Libralato
Joined: August 2006
Posts: 7192
Location: Borgo San Michele
|
CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
Since many users already asked how to create an empty page into Icy Phoenix 2.0 to insert custom content, I have decided to create this small tutorial.
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:
Name: My Fantastic Page
PageID: mypage
filename: mypage.php
Enjoy your newly created pages!
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#1 Thu 02 Aug, 2012 22:49 |
|
Sponsors
|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
Thanks for the tutorial, I am sure it will help a great many users....
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#2 Sat 04 Aug, 2012 13:14 |
|
Gianni PB
Joined: December 2006
Posts: 242
Location: New York
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
Thanks!
How can I set a page title with the second option?
|
#3 Sat 04 Aug, 2012 15:11 |
|
ThE KuKa
Joined: August 2006
Posts: 489
Location: Sabadell
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
Thanks!
How can I set a page title with the second option?
TEST...
FIND:
- $user->setup();
- // End session management
AFTER ADD:
- page_header('YOUR TITLE HERE');`
|
#4 Sat 04 Aug, 2012 22:21 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
Not sure if it hasn't been changed to this?
Examples?
// Load and process templates
$meta_content['page_title'] = $lang['Group_Control_Panel'];
page_header($meta_content['page_title'], true);
default:
$meta_content['page_title'] = $lang['Mod_CP'];
page_header($meta_content['page_title'], true);
The $lang obviously being the title?
So many changes, its difficult to know for sure without testing them. ;(
|
#5 Sun 05 Aug, 2012 05:29 |
|
Gianni PB
Joined: December 2006
Posts: 242
Location: New York
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
Kuka it works thanks
mort you have to add it in your .php files (in case of 2nd option)
|
#6 Mon 06 Aug, 2012 10:39 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
page_header('YOUR TITLE HERE');` doesn't seem to exist any more like it used to with v*53? and looks like it has been replaced or superseded with the alternative I posted. That not only adds the header location/name to the tab, it also adds the page title to the meta data from what I can see.
|
#7 Tue 07 Aug, 2012 05:19 |
|
ThE KuKa
Joined: August 2006
Posts: 489
Location: Sabadell
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
- page_header('YOUR TITLE HERE');
Works perfect in custom pages phpBB3 and Icy Phoenix 2.0 (in my test).
Can test other alternative with new var language:
- page_header($user->lang['NEW_LANG_VAR']);
OPEN ip/languages/lang_english/land_main.php file
FIND:
- //====================================================
- // Do not insert anything below this line
- //====================================================
-
- ?>
BEFORE ADD:
- // NEW PAGE TITLE - START
- $lang = array_merge($lang, array(
- 'NEW_LANG_VAR' => 'YOUR TILE PAGE',
- ));
- // NEW PAGE TITLE - END
¡¡¡TEST AGAIN!!!
|
#8 Tue 07 Aug, 2012 12:45 |
|
Mighty Gorgon
Luca Libralato
Joined: August 2006
Posts: 7192
Location: Borgo San Michele
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
You have at least two options to insert a title:
- Define
$lang['MYCONTENT'] with the content you need (if you use the lang I added in my example full_page_generation('mycontent_body.tpl', $lang['MYCONTENT'], '', ''); )
- Define
$meta_content['page_title'] with the content you need
Both should produce the same result.
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#9 Tue 07 Aug, 2012 16:49 |
|
My4ECGI7p19Y
Joined: August 2012
Posts: 1
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
Thanks man! Had this problem, and didn't know how to deal with it until now!
|
#10 Wed 29 Aug, 2012 10:07 |
|
Limun
Joined: January 2008
Posts: 1334
Location: [Censor]
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
option 2 doesnt work for me
where is the problem?
i created mycontent.php with code 2 in first post and puted it to root
than i created mycontent_body.tpl and puted it into templates/default/ with some simple html
i m using IP2.0 on localhost
____________ We are the phpBBorg. Lower your Crackers. Your phpological and forumological distinctivness will be added to our own. Resistance if futile!
|
#11 Fri 08 Feb, 2013 10:41 |
|
Mighty Gorgon
Luca Libralato
Joined: August 2006
Posts: 7192
Location: Borgo San Michele
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
Which error do you have?
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#12 Tue 19 Feb, 2013 23:13 |
|
Silverman
Joined: August 2013
Posts: 9
Location:
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
What would I need to add to get new pages in method 2 to show blocks defined in the CMS?
|
#13 Wed 21 Aug, 2013 12:48 |
|
Mighty Gorgon
Luca Libralato
Joined: August 2006
Posts: 7192
Location: Borgo San Michele
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
If you add the page to "Standard Pages" you should then be able to add CMS blocks in standard positions... let me know if you succeed.
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#14 Wed 21 Aug, 2013 18:26 |
|
Silverman
Joined: August 2013
Posts: 9
Location:
|
Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0
I did and added the blocks in the cms like normal, I see the "My Fantastic Page" but the blocks don't show.
(I kept the files retrying it as is until I get it sorted.)
|
#15 Thu 22 Aug, 2013 05:18 |
|
|
Page 1 of 2
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
Similar Topics
Similar Topics
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|