Difference between revisions of "Disabling link to talk/discussion page"

From Notes_Wiki
(Created page with "=Disabling link to talk/discussion page= To disable link to talk/discussion page for a wiki, enter following lines in '<tt>LocalSettings.php</tt>' file: <pre> $wgHooks['SkinT...")
 
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Disabling link to talk/discussion page=
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Web based tools or applications]] > [[Mediawiki configuration]] > [[Disabling link to talk/discussion page]]


To disable link to talk/discussion page for a wiki, enter following lines in '<tt>LocalSettings.php</tt>' file:
==Removing talk or discussion link using CSS==
 
To disable link to talk/discussion page follow these steps:
#Login into wiki as administrator
#Type '<tt>Mediawiki:common.css</tt>' in the search box
#Edit the page and add following line:
#:<pre>
#::#ca-talk { display:none!important; }
#:</pre>
#:This method also allows removing talk / discussion link just for single page. To achieve that use:
#::<pre>
#:::body.page-Main_Page li#ca-talk { display: none !important; }
#::</pre>
 
 
 
 
==Removing talk or discussion link using PHP==
To disable link to talk/discussion page using PHP, enter following lines in '<tt>LocalSettings.php</tt>' file:
<pre>
<pre>
$wgHooks['SkinTemplateNavigation'][] = 'replaceTabs';
$wgHooks['SkinTemplateNavigation'][] = 'replaceTabs';
Line 9: Line 27:
}
}
</pre>
</pre>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Web based tools or applications]] > [[Mediawiki configuration]] > [[Disabling link to talk/discussion page]]

Latest revision as of 13:07, 28 July 2022

Home > CentOS > CentOS 6.x > Web based tools or applications > Mediawiki configuration > Disabling link to talk/discussion page

Removing talk or discussion link using CSS

To disable link to talk/discussion page follow these steps:

  1. Login into wiki as administrator
  2. Type 'Mediawiki:common.css' in the search box
  3. Edit the page and add following line:
    1. ca-talk { display:none!important; }
    This method also allows removing talk / discussion link just for single page. To achieve that use:
    body.page-Main_Page li#ca-talk { display: none !important; }



Removing talk or discussion link using PHP

To disable link to talk/discussion page using PHP, enter following lines in 'LocalSettings.php' file:

$wgHooks['SkinTemplateNavigation'][] = 'replaceTabs';
function replaceTabs( $skin, &$links) {  
        unset( $links['namespaces']['talk'] ); // Remove the talk action
        return true;
}



Home > CentOS > CentOS 6.x > Web based tools or applications > Mediawiki configuration > Disabling link to talk/discussion page