Difference between revisions of "Configuration Notes"

From Richard's Wiki
Jump to: navigation, search
(Replacing page with '* Open external links in a new window')
Line 1: Line 1:
 
* [[Open external links in a new window]]
 
* [[Open external links in a new window]]
 
== Opening external links in a new window ==
 
The [http://www.mediawiki.org/wiki/Manual:Opening_external_links_in_a_new_window#How_to_make_external_links_open_in_a_new_window new window Wikimedia link] is useful information. Probably the easiest way is:
 
 
=== Version > 1.5.0  ===
 
# Open <tt>includes/Linker.php</tt>
 
# Find "function getExternalLinkAttributes"
 
# After
 
  <tt>$r = ($class != '') ? " class='$class'" : " class='external'";</tt>
 
  insert the following code
 
  <tt>$r .= " target=\"_blank\"";</tt>
 
 
=== Actually did this to includes/Linker.php: ===
 
<tt>
 
        function getExternalLinkAttributes( $title, $unused = null, $class='' ) {
 
                ### return $this->getLinkAttributesInternal( $title, $class, 'external' );
 
                $r = $this->getLinkAttributesInternal( $title, $class, 'external' );
 
                $r .= " target=\"_blank\"";
 
                return $r;
 
        }
 
 
</tt>
 

Revision as of 02:40, 15 November 2008