Topic on Project:Support desk

46.222.246.30 (talkcontribs)

I'm new to Mediawiki (MediaWiki 1.30.0, PHP 7.0.22, MySQL 5.7.21)

How can I remove talk tab in Vector skin for users how are not logged in?

- This seems to be old:

Manual:FAQ#How do I add.2Fremove tabs throughout my wiki.3F

- DynamicTabs is archived

- And, I saw this this post

Topic:Qji4lqoeaodggoft

but I do not know how to manage hooks, to apply it. I have to register the hook in LocalSettings.php,

$wgHooks['BeforePageDisplay'][] = 'wfHideVariousTabsFromAnonymous';

but where may a put the event handler?

function wfHideVariousTabsFromAnonymous( &$hidetabcss ) {

       global $wgUser;

       if ( !$wgUser->isLoggedIn() ) {

               $hidetabcss .= 'li#ca-history, li#ca-viewsource, li#ca-edit, li#ca-talk, .vectorMen$

       }

       return true;

}

Any help please?

Malyacko (talkcontribs)
46.222.246.30 (talkcontribs)

I tried this, but Vector.php seems different, there's no globalWrapper div.

<?php global $wgUser; if( $wgUser->isAnon() ) { ?>
     <style type="text/css">
       #ca-talk { display: none !important; }
     </style> 
   <?php } ?>
Ciencia Al Poder (talkcontribs)
46.222.246.30 (talkcontribs)

Seems to be the solution

In MediaWiki:Common.css I put:

#ca-talk { display:none!important; }

In MediaWiki:Group-user.css I put:

#ca-talk { display:block!important;}

Thanks a lot!!

This post was hidden by 46.222.246.30 (history)
This post was hidden by AhmadF.Cheema (history)