public static function navigationTabs(array &$extraTabs, $selectedTabId)
{
$extraTabs['xportal'] = array(
'title' => new XenForo_Phrase('home'),
'href' => XenForo_Link::buildPublicLink('full:xportal'),
'position' => 'home',
'linksTemplate' => 'your_tab_links_template_name',
);
}
Can you tell us what you did and what it accomplished !
$config['debug'] = 1;
<?php
class CustomIndex_Addon
{
public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data)
{
if (!$dependencies instanceof XenForo_Dependencies_Public)
{
return;
}
$config = new Zend_Config(array(
'routePrefix' => 'portal',
'controllerClass' => 'EWRporta_ControllerPublic_Portal',
'majorSection' => 'portal'
));
GeekPoint_CustomIndex_Helper::setDefaultRoute($config, $data);
}
}
?>
Had a quick look at the source code. These config settings might work:I've looked arround if this is appliable for [bd] WordPress Proxy addon, but it has no ControllerPublic. Either that or I didn't do it right.
<?php
class WpPortal_Addon
{
public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data)
{
if (!$dependencies instanceof XenForo_Dependencies_Public)
{
return;
}
$config = new Zend_Config(array(
'routePrefix' => 'blog',
'controllerClass' => 'bdWordPressProxy_Controller',
'majorSection' => 'bdWordPressProxy'
));
GeekPoint_CustomIndex_Helper::setDefaultRoute($config, $data);
}
}
?>
Yes, this is an issue with the Wordpress Proxy addon itself. $wp_widget_factory is a global variable and it's not global'ed inside the addon's controller, so that could be the reason.There is something wrong with the addon prolly because I get this error:
Fatal error: Call to a member function register() on a non-object in /[...]/blog/wp-includes/widgets.php on line 431
$options = XenForo_Application::get('options');
$options->homePageUrl = '';
Thanks. I knew it was something simple but couldn't figure it out. Simple and I don't get along well.You could set homePageUrl to an empty string, in your navigation_tabs listener.
Code:$options = XenForo_Application::get('options'); $options->homePageUrl = '';
Although doing this doesn't feel right. Because the homePageUrl setting is supposed to take precedence over any other home url. (See: XenForo_Dependencies_Public::_getNavigationContainerParams()).
Alright, I'll give you the general gist
- Upload the geekpoint folder to your library
- In your library, look at your config.php and turn your debug mode on by adding
PHP:$config['debug'] = 1;
- Still in the library, Create a new folder (I named it CustomIndex)
- Create a .php file in the newly created folder (I named it Addon.php)
- In Addon.php add the following code...
PHP:<?php class CustomIndex_Addon { public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data) { if (!$dependencies instanceof XenForo_Dependencies_Public) { return; } $config = new Zend_Config(array( 'routePrefix' => 'portal', 'controllerClass' => 'EWRporta_ControllerPublic_Portal', 'majorSection' => 'portal' )); GeekPoint_CustomIndex_Helper::setDefaultRoute($config, $data); } } ?>
- Now, go to your ACP, under the development tab, click code event listeners
- Then click Create, then setup the new event listener...
- Listen to Event is "init_dependencies"
- Execute Callback is CustomIndex_Addon :: initDependencies
Parse error: syntax error, unexpected T_STRING in Addon.php on line 9
<?php
class Eruadan_Addon
{
public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data)
{
if (!$dependencies instanceof XenForo_Dependencies_Public)
{
return;
}
$config = new Zend_Config(array(
'routePrefix' => 'pages',
'controllerClass' => 'XenForo_ControllerPublic_Page',
'params' => array('node_name' => 'testhome'),
});
GeekPoint_CustomIndex_Helper::setDefaultRoute($config, $data);
}
}
Where exactly do I slot the php in?The home "tab" that is available in stock xenforo is not a real tab. So you won't be able to select it.
You'll have to create a new event listener for navigation_tabs. Then in your callback method, append a new tab and set it's position to "home". Whatever name you give your tab, update the "majorSection" key accordingly.
PHP:public static function navigationTabs(array &$extraTabs, $selectedTabId) { $extraTabs['xportal'] = array( 'title' => new XenForo_Phrase('home'), 'href' => XenForo_Link::buildPublicLink('full:xportal'), 'position' => 'home', 'linksTemplate' => 'your_tab_links_template_name', ); }
We use essential cookies to make this site work, and optional cookies to enhance your experience.