Skip to main content
Topic: SMF Portal / Home Page for forum (Read 13318 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

SMF Portal / Home Page for forum

Hi guys,

I kinda want to make a home page just like ElkArte's home page.. any suggestions on how I should go about it?

So far what I've found in this community is mainly a discussion on what to put in the front page of Elk Arte's site, but nothing much regarding how one can go about it.. :/

Mainly, I wanna know how to add a "Home" button / page and making that the default first page in index.php..

Facta, non verba.

Re: SMF Portal / Home Page for forum

Reply #1

Either SimplePortal http://addons.elkarte.net/feature/Simple-Portal.html (but I feel it's not working with 1.1), or you can have a look at the files we use here https://github.com/elkarte/elkarte.net/tree/master/elk (the name may be a little off (home/index.php).

Regarding the home button, I'm pretty sure I posted the addon used here somewhere, but I can't find it at the moment... :-\
 emanuele 's search skills s**k
Bugs creator.
Features destroyer.
Template killer.

Re: SMF Portal / Home Page for forum

Reply #2

Okay I sort of "found" Frontpageinterface.php after reading up:
http://www.elkarte.net/community/index.php?topic=2859.0

It's a built-in function to enable any page to replace index.php if I am not mistaken..

But right now, there's just no visual admin interface to enable it right?

What's the manual way of doing it?



Also, I'm trying to figure this out to see if it works lol:
http://www.elkarte.net/community/index.php?topic=2846
Facta, non verba.

Re: SMF Portal / Home Page for forum

Reply #3

I am using this line of code in .htaccess:

Code: [Select]
DirectoryIndex start.php index.php

start.php is loaded instead of index.php. If start.php isn't found index.php is loaded instead.

Re: SMF Portal / Home Page for forum

Reply #4

Quote from: Jorin – I am using this line of code in .htaccess:

Code: [Select]
DirectoryIndex start.php index.php

start.php is loaded instead of index.php. If start.php isn't found index.php is loaded instead.

Hi Jorin, what is the code inside "start.php"?
Facta, non verba.

Re: SMF Portal / Home Page for forum

Reply #5

Quote from: niloc – Okay I sort of "found" Frontpageinterface.php after reading up:
http://www.elkarte.net/community/index.php?topic=2859.0

It's a built-in function to enable any page to replace index.php if I am not mistaken..

Yep, in 1.1 there is this interface as well, there is a bug though (i.e. no "forum" button when the front page is changed... sorry, I forgot to fix it in B1, will have to make it in B2).

To see how the front page interface works you can have a look at BoardIndex.controller, the whole thing is:
Code: [Select]
use ElkArte\sources\Frontpage_Interface;

if (!defined('ELK'))
die('No access...');

/**
 * BoardIndex_Controller class
 * Displays the main board index
 */
class BoardIndex_Controller extends Action_Controller implements Frontpage_Interface
{
/**
* {@inheritdoc }
*/
public static function frontPageHook(&$default_action)
{
$default_action = array(
'controller' => 'BoardIndex_Controller',
'function' => 'action_boardindex'
);
}

Write a class that extends Action_Controller and implements Frontpage_Interface, then you add a "public static function frontPageHook" that takes the default action and changes it to whatever your front page controller will be.

Quote from: niloc – But right now, there's just no visual admin interface to enable it right?
The admin interface is there, in the layout settings (it seemed the most logical to me, but maybe is not).
Bugs creator.
Features destroyer.
Template killer.

Re: SMF Portal / Home Page for forum

Reply #6

Any code that make your frontpage @niloc