XF 2.2 Move watched threads to new tab

Robert9

Well-known member
I tried to move the watched/threads to a new tab in the main navi, but i dont now how.
Is this possible?

I have Forums | Watched Threads
i move watched/threads in the second navi from forums to the new tab "Watched Threads".
When i call {{ link('watched/threads') }} the tab "Watched threads" should be highlighted.
 
Solution
Create the nav tab:

1614889687637.png

Edit the watched_threads_list template and add this at the top:

HTML:
<xf:page option="section">test</xf:page>

1614889789396.png

Change test to match the Navigation ID.

1614889827899.webp
Code:
namespace XF\Pub\Controller;

use XF\Mvc\ParameterBag;

class Watched extends AbstractController
{
    protected function preDispatchController($action, ParameterBag $params)
    {
        $this->assertRegistrationRequired();
    }

    public function actionThreads()
    {
        $this->setSectionContext('forums');


Looks like that the section is hardcoded in the source. Means that we cant move it to another tab without to extend the method.
 
Create the nav tab:

1614889687637.png

Edit the watched_threads_list template and add this at the top:

HTML:
<xf:page option="section">test</xf:page>

1614889789396.png

Change test to match the Navigation ID.

1614889827899.webp
 
Solution
Top Bottom