SimplePortal

Support => English Support => Topic started by: akshtsaklani7 on October 09, 2014, 12:33:14 PM

Title: Standalone portal link in linktree
Post by: akshtsaklani7 on October 09, 2014, 12:33:14 PM
Hello,

I wanted to edit my sites linktree. I use simple portal's standalone homepage. By default the linktree is like:-

The Ultimate Step | category | board | topic

where "the ultimate step" redirects to forum index.

But I want  it like,

The Ultimate Step | forum | category | board | topic

where "the ultimate step" should redirect to portal homepage, and "forum" should redirect to forum index. And on homepage, the linktree should display "the ultimate step" alone.

Reading older threads, I edited subs-portal.php file and added

Code: [Select]
if ($modSettings['sp_portal_mode'] == 3)
{
if($context['SPortal']['on_portal'] == 1 || isset($_REQUEST['page']))
{
$context['linktree'][0] = array(
'url' => $modSettings['sp_standalone_url'],
'name' => $context['forum_name'],
);

}
else
{
array_unshift($context['linktree'], array(
'url' => $modSettings['sp_standalone_url'],
'name' => $context['forum_name'],
));

$context['linktree'][1] = array(
'url' => $scripturl . '?action=forum',
'name' => empty($txt['sp-forum']) ? 'Forum' : $txt['sp-forum'],
);

}
}

After
Code: [Select]
if ($modSettings['sp_portal_mode'] == 1)
$context['linktree'][0] = array(
'url' => $scripturl . '?action=forum',
'name' => $context['forum_name'],
);

Now, I have a link tree like
The Ultimate Step | forum | category | board | topic

The only problem is, both on standalone page and forum index, it appears
The Ultimate Step | forum

where it should be
The Ultimate Step  on standalone page and
The Ultimate Step | forum  on forum index page.

Please help.
Title: Re: Standalone portal link in linktree
Post by: [SiNaN] on October 11, 2014, 05:15:53 AM
For 2.3.6:

Subs-Portal.php

Code: (Find) [Select]
$context['standalone'] = $standalone;
Code: (Replace) [Select]
if ($modSettings['sp_portal_mode'] == 3)
{
if (!$standalone)
{
array_unshift($context['linktree'], array(
'url' => $modSettings['sp_standalone_url'],
'name' => $context['forum_name'],
));

$context['linktree'][1] = array(
'url' => $scripturl . '?action=forum',
'name' => empty($txt['sp-forum']) ? 'Forum' : $txt['sp-forum'],
);
}
else
array_pop($context['linktree']);
}

$context['standalone'] = $standalone;
Title: Re: Standalone portal link in linktree
Post by: akshtsaklani7 on October 11, 2014, 09:10:14 AM
Working. Thanks :)
Title: Re: Standalone portal link in linktree
Post by: [SiNaN] on October 11, 2014, 09:15:29 AM
You're welcome. Marking as solved.
SimplePortal 2.3.8 © 2008-2024, SimplePortal