Could this be used for loading a custom php file as the home page?
Cheers
Sadly close to everything uses the default xenforo index so I couldn't do thisBut if you are using a completely custom php file why dont you try just naming it index.php and renaming the current index to index1 or the likes and use it in the root? and then have it link to the forum etc from there? You can link the forums homepage tab to you custom php file from there?
Sadly close to everything uses the default xenforo index so I couldn't do this
Thanks for the info and I'll give it a try anyway
haha nah its fineOh right It did seem to have an odd structure vs the VB index. Im still a week into xenforo altho that is no excuse and I shall keep my mouth shut in the future unless im doubly sure. My bad :/
well am only quoting my time when I tryed to use wordpress index in the same dir as xenforo and it was 110% fail (for me anyway)Strange tho I manage to call the login drop down via my custom index.html file when I tested I just didn't use it or go further because I found this mod and I figured 'd just use a page for my splash front. Maybe because it was an html? and the index.php was still intact?
Yea thinking more into this I might just use a custom template and dumb all my html in it that would work as the only php I have in the file is "pulling" all the xenforo js, css and loginbar/userbar (like my booru does)And lol if you do try shoving it into the existing php and it does work let me know. I'd try it out but I havent installed a test board yet and swamped with work :/
Brogan had used a htaccess redirect and suggested I do the same when I was snooping around to have my own custom page.
<?php
class EWRporta_Listener_Init
{
public static function listen(XenForo_Dependencies_Abstract $dependencies, array $data)
{
if (!$dependencies instanceof XenForo_Dependencies_Public)
{
return;
}
if (XenForo_Application::get('options')->EWRporta_index)
{
$config = new Zend_Config(array(
'routePrefix' => 'portal',
'controllerClass' => 'EWRporta_ControllerPublic_Portal',
'majorSection' => 'portal',
'minorSection' => 'layout_id'
));
EWRporta_Helper_Index::setDefaultRoute($config, $data);
}
}
}
<?php
class EWRporta_Route_Portal implements XenForo_Route_Interface
{
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$action = $router->resolveActionWithStringParam($routePath, $request, 'layout_id');
return $router->getRouteMatch('EWRporta_ControllerPublic_Portal', $action, 'portal');
}
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'layout_id');
}
}
$this->canonicalizeRequestUrl(XenForo_Link::buildPublicLink('portal', array('layout_id' => $layoutId)));
Quick Comparison of route prefixes, used for matching:
Stock XenForo:
Shifting forum home to its separate route-prefix:
- homepage: /index/ (points to the forum home)
- individual forums: /forums/
- individual threads: /threads/
- individual pages: /pages/
Jaxel is right in that it's more work for me to reuse the /forums/ route prefix, because it already is used for displaying individual forums and sub-forums. So shifting the forum home to a separate route prefix (/forum/) is easier.
- homepage: /index/ (points to your own controller)
- forum home: /forum/
- individual forums: /forums/
- individual threads: /threads/
- individual pages: /pages/
public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data)
{
if (!$dependencies instanceof XenForo_Dependencies_Public)
{
return;
}
$config = new Zend_Config(array(
'routePrefix' => 'recent-activity',
'controllerClass' => 'XenForo_ControllerPublic_RecentActivity',
));
GeekPoint_CustomIndex_Helper::setDefaultRoute($config, $data);
}
public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data) { if (!$dependencies instanceof XenForo_Dependencies_Public) { return; } $config = new Zend_Config(array( 'routePrefix' => 'recent-activity', 'controllerClass' => 'XenForo_ControllerPublic_RecentActivity', )); GeekPoint_CustomIndex_Helper::setDefaultRoute($config, $data); }
We use essential cookies to make this site work, and optional cookies to enhance your experience.