Difference between revisions of "Talk:Transclusion"

(Tag: 2017 source edit)
(Tag: 2017 source edit)

if you set the read-permission explicit for one user group in any namespace, transclusions won't work anymore..

this inline hack (for your localsettings.php) should help:

/

                    * array of namespace ids (NS_MAIN, NS_HELP, etc)
                
                    
* when empty: all namespace ar transcludable!
                
                    
/
$bsgForceNsTranscludable = array( NS_MAIN, NS_TEMPLATE );
$wgExtensionFunctions[]=function()use($bsgForceNsTranscludable){$g=&$GLOBALS['wgNonincludableNamespaces'];$Ns=$bsgForceNsTranscludable;$g=empty($Ns)?$Ns:array_filter($g,function($e)use($Ns){
                
return 
                    return !in_array($e,$Ns);});};

                
if you set the read-permission explicit for one user group in any namespace, transclusions won't work anymore..
        
        
        
        this inline hack (for your localsettings.php) should help:
        
        
        
        
        /<syntaxhighlight lang="php">
        
        * array of namespace ids (NS_MAIN, NS_HELP, etc)
        
        * when empty: all namespace ar transcludable!
        
        /
        
        $bsgForceNsTranscludable = array( NS_MAIN, NS_TEMPLATE );
        
        $wgExtensionFunctions[]=function()use($bsgForceNsTranscludable){$g=&$GLOBALS['wgNonincludableNamespaces'];$Ns=$bsgForceNsTranscludable;$g=empty($Ns)?$Ns:array_filter($g,function($e)use($Ns){return !in_array($e,$Ns);});};
            
            
            </syntaxhighlight>
Line 3: Line 3:
 
this inline hack (for your localsettings.php) should help:
 
this inline hack (for your localsettings.php) should help:
  
/
+
<syntaxhighlight lang="php">
 
* array of namespace ids (NS_MAIN, NS_HELP, etc)
 
* array of namespace ids (NS_MAIN, NS_HELP, etc)
 
* when empty: all namespace ar transcludable!
 
* when empty: all namespace ar transcludable!
Line 9: Line 9:
 
$bsgForceNsTranscludable = array( NS_MAIN, NS_TEMPLATE );
 
$bsgForceNsTranscludable = array( NS_MAIN, NS_TEMPLATE );
 
$wgExtensionFunctions[]=function()use($bsgForceNsTranscludable){$g=&$GLOBALS['wgNonincludableNamespaces'];$Ns=$bsgForceNsTranscludable;$g=empty($Ns)?$Ns:array_filter($g,function($e)use($Ns){return !in_array($e,$Ns);});};
 
$wgExtensionFunctions[]=function()use($bsgForceNsTranscludable){$g=&$GLOBALS['wgNonincludableNamespaces'];$Ns=$bsgForceNsTranscludable;$g=empty($Ns)?$Ns:array_filter($g,function($e)use($Ns){return !in_array($e,$Ns);});};
 +
</syntaxhighlight>