• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Implemented Option to remove cookie help page

Chris D

XenForo developer
Staff member
#2
You can remove it by modifying the contents of the help_sidebar_links hook if you want to do it in an add-on way.

This is the link in the sidebar in the help_wrapper template:
<li><a href="{xen:link help/cookies}" class="{xen:if "{$selected} == 'cookies'", 'secondaryContent', 'primaryContent'}">{xen:phrase cookie_usage}</a></li>

I guess you could remove it from the main help_index with a templatePostRender?
 
R

ragtek

Guest
#3
thx
i've tried to remove it with regex on templatePostRender, but complex regex is still too complicated for me, that's why it didn't work
now i'm doing it probably the dirty way, but it's working..:D

i've tried to build an regex to search for
Code:
<li><a href="help/cookies" ...>...</a></li>



if anybody else is interessted:
this templatehook code will remove the links from the help navbar menu and help sidebar menu:
PHP:
            switch ($name){
                case 'help_sidebar_links':
                    $remove = '<li><a href="help/cookies" class="primaryContent">' . new XenForo_Phrase('cookie_usage') . '</a></li>';
 
                    $contents = str_replace($remove,'', $contents);
 
                    break;
                case 'navigation_tabs_help':
                    $remove = '<li><a href="help/cookies">' . new XenForo_Phrase('cookie_usage').'</a></li>';
                    $contents = str_replace($remove,'', $contents);
                    break;
            }
 

Luxus

Well-known member
#4
Will this code remove the cookie page entirely? Meaning if people visit "...help/cookies" they would get a 404 error page?
 

Chris D

XenForo developer
Staff member
#7
This could be made into an add-on, but here's a code edit:

library/XenForo/ControllerPublic/Help.php

Find:

PHP:
	public function actionCookies()
	{
		return $this->_getWrapper('cookies',
			$this->responseView('XenForo_ViewPublic_Help_Cookies', 'help_cookies')
		);
	}
Replace With:

PHP:
	public function actionCookies()
	{
		return $this->responseError(new XenForo_Phrase('requested_page_not_found'), 404);
	}
Actually... **** it... I will create an add-on for this.