tenants
Well-known member
There seems to be a bug with setIndexRoute that affects how template links appear
If I set the index route for my home page as:
XenForo_Link::setIndexRoute('xz-articles');
The home page gets set correctly (so I can navigate to example.com), but when clicking the link from the nav, I'm redirected to the example.com/xz-articles
However, If I set the route using
XenForo_Link::setIndexRoute('xz-articles/');
Then both the nav link and navgating to the site direct me to example.com (as expected)
However, if the route prefix has an action, then the reverse is true
XenForo_Link::setIndexRoute('xz-articles/category-list'); Works
XenForo_Link::setIndexRoute('xz-articles/category-list/'); Doesn't work
my work around for now is to use:
But you can see that this is a bit strange
If I set the index route for my home page as:
XenForo_Link::setIndexRoute('xz-articles');
The home page gets set correctly (so I can navigate to example.com), but when clicking the link from the nav, I'm redirected to the example.com/xz-articles
However, If I set the route using
XenForo_Link::setIndexRoute('xz-articles/');
Then both the nav link and navgating to the site direct me to example.com (as expected)
However, if the route prefix has an action, then the reverse is true
XenForo_Link::setIndexRoute('xz-articles/category-list'); Works
XenForo_Link::setIndexRoute('xz-articles/category-list/'); Doesn't work
my work around for now is to use:
Code:
switch ($options->xzSetHomePage)
{
case 'article_list':
XenForo_Link::setIndexRoute('xz-articles/');
break;
case 'category_list':
XenForo_Link::setIndexRoute('xz-articles/category-list');
break;
case 'editors_picks':
XenForo_Link::setIndexRoute('xz-articles/editors-picks');
break;
default:
break;
}
But you can see that this is a bit strange
Last edited: