Example to get this working
ftp down your LocalSettings.php file
add the following 2 lines of code:
$wgExtraNamespaces = array(100 => "YOURNAMESPACE", 101 => "YOURNAMESPACE_talk"); $wgNamespacesWithSubpages = true;
upload the LocalSettings.php file
create the following as the parent page name: YOURNAMESPACE:Home
then create the following as a childpage name: YOURNAMESPACE:Home/Child1
this will embed a simple < YOURNAMESPACE:Home link at the top of the child. Unfortunately, the page name is mucked up with the namespace, colon, parent, and slash.
Problems with subpages in the main namespace
site: wikademia.org -> subpages are not working in main namespace... some sort of error. If you take a look and can tell me how to fix it, then 1000 thanks. Thanks.
- in .htaccess? I don't even see a .htaccess ... or somewhere else?
Disable subpages for all namespaces
Hello, will this directive disable subpages for all namespaces?
$wgNamespacesWithSubpages = array();
--18.104.22.168 16:04, 6 June 2010 (UTC)
- It should. --Bachsau 10:44, 8 July 2010 (UTC)
# Enable subpages in the main namespace $wgNamespacesWithSubpages[NS_MAIN] = true;
Nothing in mediawiki 1.6.
Why disable by default?
Why are most of the core (non-talk) namespaces disabled by default? Wikipedia has most of them enabled. And the only reason they disable it for the mainspace is for encyclopedia structure. For a general-purpose wiki I see even less of a reason to disable subpages. 22.214.171.124 01:23, 29 February 2012 (UTC)
- The distinction dates back to pre r1284 which is the dark ages. Back in those days, mediawiki's default config much more reflected how things were wanted on wikipedia instead of wikipedia having custom config in cases where they wanted weird things. Thus I'd guess its mostly for historical reasons, and no one has ever changed it. Bawolff (talk) 04:02, 29 February 2012 (UTC)
From what I can tell from InitialiseSettings.php, it's usually:
$wgNamespacesWithSubpages = array( NS_MAIN => false, // False as MW default and on all WMF wikis except Wikisource, Wikiversity, ArbCom, etc. NS_TALK => true, // True as MW default and on all WMF wikis NS_USER => true, // True as MW default and on all WMF wikis NS_USER_TALK => true, // True as MW default and on all WMF wikis NS_PROJECT => true, // False as MW default, but almost every WMF wiki sets it to true NS_PROJECT_TALK => true, // True as MW default and on all WMF wikis NS_IMAGE => false, // False as MW default and on all WMF wikis NS_IMAGE_TALK => true, // True as MW default and on all WMF wikis NS_MEDIAWIKI => false, // False as MW default and on almost all WMF wikis NS_MEDIAWIKI_TALK => true, // True as MW default and on all WMF wikis NS_TEMPLATE => true, // True as MW default and on most major WMF wikis NS_TEMPLATE_TALK => true, // True as MW default and on all WMF wikis NS_HELP => true, // False as MW default but true on almost all WMF wikis NS_HELP_TALK => true, // True as MW default and on all WMF wikis NS_CATEGORY => false, // False as MW default and on most WMF wikis NS_CATEGORY_TALK => true, // True as MW default and on almost all WMF wikis // Everything above 100 is usually true );
No more than 200 namespaces OR no namespace with an index greater than 200?
# Enable subpages in all namespaces $wgNamespacesWithSubpages = array_fill( 0, 200, true );
The above example of how to go about enabling this for all namespaces claims, "This assumes you have no more than 200 namespaces." Is it accurate to say "no more than 200 namespaces" OR would "no namespace with an index greater than 200" be more accurate? I ask because although we only have 21 namespaces on our wiki, we have one with an index of 500 (501 for talk). -- Thanks, ShoeMaker ( Contributions • Message ) 16:48, 13 February 2013 (UTC)
consequences of disabling after having it be enabled
I want to disable the feature of $wgNamespacesWithSubpages so that it will not apply one of my nav templates to subpages. I am worried that it will have more of an effect on my wiki then I care to deal with. Are there any major consequences/issues that will occur if i disable $wgNamespacesWithSubpages after having it be enabled for the entires wiki's life?
- I guess that with "disabling $wgNamespacesWithSubpages" you mean that you want to set it to an empty array.
- That would have the effect that you cannot create subpages in any namespace. The question then is what then happens with those subpages that already are there? I guess (unchecked) that they are not immediately deleted *sigh* only because you set that value. However, what I could imagine is that you might then have problems editing them. To be on the save side, I would first move all subpages to a place, which also is valid after disabling $wgNamespacesWithSubpages by setting it to an empty array. Meaning: Move them so that they no longer are subpages and then disable $wgNamespacesWithSubpages. --126.96.36.199 10:14, 22 June 2014 (UTC)