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..
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... :-\
/me 's search skills s**k
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
I am using this line of code in
.htaccess:
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"?
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:
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.
The admin interface is there, in the layout settings (it seemed the most logical to me, but maybe is not).
Any code that make your frontpage
@niloc