Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Tutorial:: How to make a custom home page

Asked Modified Viewed 18,910 times
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
asked
Fusioneer

Tutorial:: How to make a custom home page

Many PHPFusion users ask these same two questions many times.

How do I make a custom home page?
How do I exclude news from the main page?


Here is how to do it.


________________________________________________



Making The Home Page File
First off we need a file that calls the PHPFusion maincore header and footer.
[ulist=disc]Copy the code below then paste into notepad++ or whatever software you use to code with.
Save the file naming it whatever you want your home page to be called.
Some suggestions for good home page names are home.php, front_page.php, or start.php
Upload the file to your PHPFusion sites main root directory. [/ulist]

<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright © 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";

require_once THEMES."templates/footer.php";
?>



________________________________________________



Adding Panels To Your New Home Page
Now you have made your home page file and uploaded it to your site the next thing we will do is we will want to display some panels on it.

If we want Centre Panels to display on the new home page but we do not want the panels to display on any other page other than the new home page we do that through the Admin >>> System >>> Panels Administration on your site.

[ulist=disc]Go to Admin >>> System >>> Panels
Select Add New Upper or Lower Centre Panels
Select the panel you wish to use for your home page only from the panels dropdown list.
Go to the Panel Restriction text box and enter the name of your new home page like so /home.php
Select Include on these pages
Select Display panel on all pages
Set access
Enter your Admin Password
Save and enable the panel.[/ulist]


www.phpfusionmods.co.uk/forum/attachments/panel_restriction.png



________________________________________________



Setting Up Your Site To Open With Your New Home Page
Now we need to set up your site so that the opening page is now your new home page.

[ulist=disc]Go to Admin >>> Settings >>> Main
Scroll down to site Opening page and enter the name of your new home page like so /home.php
Done.
[/ulist]


That's it done, your new home page is now set up.


________________________________________________



Some Ideas for Panels To Display on Your New Home Page
Here are two panels which I recommend for use with your new home page.

FP News Panel

www.phpfusionmods.co.uk/downloads/images/fp_news_panel_preview.png


FP New Panel is ideal for displaying news on your new home page you can display the news the standard single column way or double column.

FP Latest Downloads Panel

www.phpfusionmods.co.uk/downloads/images/fp_latest_downloads_panel_preview.png


This Latest Downloads Panel is great for home pages displays latest downloads in a nice centre panel with image thumbs and other various Downloads stats.
Edited by Craig on 26-04-2014 12:15,
0 replies

15 posts

K
Kevin Maschke
K
<3 PHP-Fusion
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 25 threads in the forums
answered
Member

WOW!!

Thanks a lot Fangree. Really nice post! It'll help a lot or people!

I'm also currently working on a personal home page, but I think that I'll include all panels and code directly into home.php (or whatever I'll call it at the end).


But really really great post!
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Of course if you do not use php-fusion v7.02 panels can be added directly into the home page file. However when using 7.02 no need to place anything in the file since panels can now be included exactly where you want them so all is good.
0 replies
K
Kevin Maschke
K
<3 PHP-Fusion
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 25 threads in the forums
answered
Member

Quote

Fangree_Craig wrote:

Of course if you do not use php-fusion v7.02 panels can be added directly into the home page file. However when using 7.02 no need to place anything in the file since panels can now be included exactly where you want them so all is good.



Yes, of course.

I do use php-fusion, but I want my homepage to use a different design as the rest of the website. :)
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

That tooo can be done using panels.

Want an example?

Lets say you want the layout to be 2 rows and 3 collumns so in a empty Center panel we add the table like so......


echo"<table style='width: 100%;' border='0' align='center'>
<tr>
<td>";
echo" a code here";
echo"</td>";
echo"<td>";
echo" another code";
echo"</td>";
echo"<td>";
echo"a code again.";
echo"</td>
</tr>
<tr>";
echo"<td>";
echo"anoter code";
echo"</td>";
echo"<td>";
echo"More code";
echo"</td>";
echo"<td>";
echo cooooode";
echo"</td>
</tr>
</table>";


In between all the <td></td> s this is where you include the panels you want to display on the page.

Of course the <td> might need some style like set a width and vertical-align:top; etc to get it to look good but play around it will work eventually.

Basically 1 centre panel to display all your sites panels. hehe.
0 replies
H
Homdax
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,246 posts on the community forums.
  • Started 108 threads in the forums
answered
Fusioneer

Damn Craig is really useful. Gotta remember that...:P

TD? Arent that deprecated? Sorta?
I mean it works but everyone is so into using divs and css positioning...
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Well of course you can always use divs instead but that is how to do it using a table.

I will show a div example soon k.
0 replies
— 4 months later —
I
i7Grendel
I
  • Junior Member, joined since
  • Contributed 16 posts on the community forums.
  • Started 5 threads in the forums
answered
Junior Member

Well, I just make a custom page and use the link to that page as my homepage address. Isn't that much easier?
0 replies
— 2 years later —
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

It can be if you want your site link looking like mysite.com/viewpage.php?page_id=30000, looks terrible imo.
0 replies
— 1 month later —
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Can use SEO infusion. But, no worry there, we'll soon have SEO.
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

This thread is old look at my last post, think it got spammed thus the reason its bumped but look at my last post date lol

Anyway your reply is still valid so aye seo aye. :G
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Oh. My bad :D
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

:D
0 replies
— 1 year later —
S
SkeeredOfMyMind
S
[size=24]HELP WANTED FOR PHP-FUSION PROJECTS[/size]
[size=12]I am seeking Web Developers & Designers, Graphic Developers & Designers, Web, Mobile App & Computer Program Coders & Programmers & Beta & Alpha Testers for new PHP-Fusion Add-Ons like Themes, Infusions, BB-Codes and ETC, as well as Websites, Mobile App & Computer Programs to help me develop, design, code & program new PHP-Fusion Add-Ons, Websites, Mobile Apps & Computer Programs and I also need some people to test those in the Beta & Alpha stages both. All jobs are paid and are freelance jobs. Please message me here if interested for a list of available positions and projects. [/size]
  • Member, joined since
  • Contributed 120 posts on the community forums.
  • Started 44 threads in the forums
answered
Member

This totally still works and is awesome. My problem was I had panels appearing above the content and silly me didn't think to make them Lower Panels so I created the page as a panel and it works. When editing the code I realized I totally forgot to include:

require_once "maincore.php";
require_once THEMES."templates/header.php";

require_once THEMES."templates/footer.php";


It didn't seem to make any difference or throw errors without that code and everything appeared just fine, which is odd.

I am using HTML with my page so it looks like this:

<?php
Information always included........
require_once "maincore.php";
require_once THEMES."templates/header.php";

require_once THEMES."templates/footer.php";
?>

<HTML>My Page text</HTML>

<?php
?>


My question is, does it make a difference if the code
Vrequire_once "maincore.php";
require_once THEMES."templates/header.php";

require_once THEMES."templates/footer.php";


is at the top or bottom of the page? And is my code formatted properly for using HTML inside PHP?
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

You are mixing the terms some here, I am not entirly sure what you are creating.

Panel is one thing. Customfile as in myfile.php and Custompages as in viewpage.php?xx is two other things.
Panels and custompages do not require includes such as,
require_once "maincore.php";
require_once THEMES."templates/header.php";
require_once THEMES."templates/footer.php";

When you make a new file that you link to, then includes are required.
Your above format are a tad off,it should be

<?php
require_once "maincore.php";
require_once THEMES."templates/header.php";
?>

<HTML>My Page text</HTML>

<?php
require_once THEMES."templates/footer.php";
?>

0 replies
S
SkeeredOfMyMind
S
[size=24]HELP WANTED FOR PHP-FUSION PROJECTS[/size]
[size=12]I am seeking Web Developers & Designers, Graphic Developers & Designers, Web, Mobile App & Computer Program Coders & Programmers & Beta & Alpha Testers for new PHP-Fusion Add-Ons like Themes, Infusions, BB-Codes and ETC, as well as Websites, Mobile App & Computer Programs to help me develop, design, code & program new PHP-Fusion Add-Ons, Websites, Mobile Apps & Computer Programs and I also need some people to test those in the Beta & Alpha stages both. All jobs are paid and are freelance jobs. Please message me here if interested for a list of available positions and projects. [/size]
  • Member, joined since
  • Contributed 120 posts on the community forums.
  • Started 44 threads in the forums
answered
Member

I apologize as my post was a little confusing.I was trying to explain what I had done to avoid some issues I was experiencing with panels displaying before my page content. I used the code to create a page. When I created the page, I had panels appearing above the page content. At the time I was not thinking those panels were set as Upper Panels. I left the page but did not link to it. Thinking I'd later ask for help here with it.

I used the code for my page I had created for my page and yes, including this code and I created a panel for the page. I did not create the panel through the System Admin>Panels area, I manually uploaded it as a panel named name_page_panel and set it as an Upper Panel and put it at the very top and it did work. That is when I realized the other panels were also set as Upper Panels and that's why they appeared above my page content. You are correct, panels created through System Admin>Panels would probably not even allow that code and do not require it at all.

After realizing why the panels were appearing before my page content, I made them all Lower Panels and everything has now worked out just fine, except I just ran into a few issues with changing text colors and a few other things when I had all the code at the top instead of the footer code being at the bottom where it should be.

Thanks very much for your clarification on this Falk.
Edited by N/A on 15-05-2016 08:23,
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 15 posts
  • Votes 0 votes
  • Topic users 7 members

7 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
H
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,246 posts on the community forums.
  • Started 108 threads in the forums
C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
K
K
<3 PHP-Fusion
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 25 threads in the forums
C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
I
I
  • Junior Member, joined since
  • Contributed 16 posts on the community forums.
  • Started 5 threads in the forums
S
S
[size=24]HELP WANTED FOR PHP-FUSION PROJECTS[/size]
[size=12]I am seeking Web Developers & Designers, Graphic Developers & Designers, Web, Mobile App & Computer Program Coders & Programmers & Beta & Alpha Testers for new PHP-Fusion Add-Ons like Themes, Infusions, BB-Codes and ETC, as well as Websites, Mobile App & Computer Programs to help me develop, design, code & program new PHP-Fusion Add-Ons, Websites, Mobile Apps & Computer Programs and I also need some people to test those in the Beta & Alpha stages both. All jobs are paid and are freelance jobs. Please message me here if interested for a list of available positions and projects. [/size]
  • Member, joined since
  • Contributed 120 posts on the community forums.
  • Started 44 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet