[MediaWiki-l] Custom namespace additions via $wgExtraNamespaces

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[MediaWiki-l] Custom namespace additions via $wgExtraNamespaces

John Foster-2
I have the following in my LocalSettings.php file:

// define namespace constants
define("NS_Portal", 100); // This MUST be even.
define("NS_Portal_TALK", 101); // This MUST be the following odd integer.
// add namespaces
$wgExtraNamespaces[NS_Portal] = "Portal";
$wgExtraNamespaces[NS_Portal_TALK] = "Portal_talk";


However tihis is not creating the "Portal" custom NameSpace. I've likely
got this wrong somehow, but don't know what.
Any tips.
Thanks!
john

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Custom namespace additions via $wgExtraNamespaces

Larry Silverman
You are colliding with reserved namespace IDs. See
https://www.mediawiki.org/wiki/Extension_namespace_registration

Start with a much higher number. I started my custom namespaces at 5100 to
stay clear of any reserved IDs.

Larry Silverman
Chief Technology Officer
TrackAbout, Inc.

On Mon, Sep 15, 2014 at 2:57 PM, John Foster <[hidden email]> wrote:

> I have the following in my LocalSettings.php file:
>
> // define namespace constants
> define("NS_Portal", 100); // This MUST be even.
> define("NS_Portal_TALK", 101); // This MUST be the following odd integer.
> // add namespaces
> $wgExtraNamespaces[NS_Portal] = "Portal";
> $wgExtraNamespaces[NS_Portal_TALK] = "Portal_talk";
>
>
> However tihis is not creating the "Portal" custom NameSpace. I've likely
> got this wrong somehow, but don't know what.
> Any tips.
> Thanks!
> john
>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Custom namespace additions via $wgExtraNamespaces

John Doe-27
Try just:
$wgExtraNamespaces[100] = "Portal";

On Mon, Sep 15, 2014 at 6:41 PM, Larry Silverman <[hidden email]>
wrote:

> You are colliding with reserved namespace IDs. See
> https://www.mediawiki.org/wiki/Extension_namespace_registration
>
> Start with a much higher number. I started my custom namespaces at 5100 to
> stay clear of any reserved IDs.
>
> Larry Silverman
> Chief Technology Officer
> TrackAbout, Inc.
>
> On Mon, Sep 15, 2014 at 2:57 PM, John Foster <[hidden email]>
> wrote:
>
> > I have the following in my LocalSettings.php file:
> >
> > // define namespace constants
> > define("NS_Portal", 100); // This MUST be even.
> > define("NS_Portal_TALK", 101); // This MUST be the following odd integer.
> > // add namespaces
> > $wgExtraNamespaces[NS_Portal] = "Portal";
> > $wgExtraNamespaces[NS_Portal_TALK] = "Portal_talk";
> >
> >
> > However tihis is not creating the "Portal" custom NameSpace. I've likely
> > got this wrong somehow, but don't know what.
> > Any tips.
> > Thanks!
> > john
> >
> > _______________________________________________
> > MediaWiki-l mailing list
> > To unsubscribe, go to:
> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
> >
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Custom namespace additions via $wgExtraNamespaces

John Foster-2
Actually did what both of you suggested:
Also I used all caps inside the define, I think that is also required.

# Adding specialized 'namespaces'
define( "NS_PORTAL", 1000 );
define( "NS_PORTAL_TALK", 1001 );
$wgExtraNamespaces = array( 1000 => "Portal", 1001 => "Portal_talk" );


Now it all works just fine. Thanks!!
John


On 09/15/2014 05:45 PM, John wrote:

> Try just:
> $wgExtraNamespaces[100] = "Portal";
>
> On Mon, Sep 15, 2014 at 6:41 PM, Larry Silverman <[hidden email]>
> wrote:
>
>> You are colliding with reserved namespace IDs. See
>> https://www.mediawiki.org/wiki/Extension_namespace_registration
>>
>> Start with a much higher number. I started my custom namespaces at 5100 to
>> stay clear of any reserved IDs.
>>
>> Larry Silverman
>> Chief Technology Officer
>> TrackAbout, Inc.
>>
>> On Mon, Sep 15, 2014 at 2:57 PM, John Foster <[hidden email]>
>> wrote:
>>
>>> I have the following in my LocalSettings.php file:
>>>
>>> // define namespace constants
>>> define("NS_Portal", 100); // This MUST be even.
>>> define("NS_Portal_TALK", 101); // This MUST be the following odd integer.
>>> // add namespaces
>>> $wgExtraNamespaces[NS_Portal] = "Portal";
>>> $wgExtraNamespaces[NS_Portal_TALK] = "Portal_talk";
>>>
>>>
>>> However tihis is not creating the "Portal" custom NameSpace. I've likely
>>> got this wrong somehow, but don't know what.
>>> Any tips.
>>> Thanks!
>>> john
>>>
>>> _______________________________________________
>>> MediaWiki-l mailing list
>>> To unsubscribe, go to:
>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>
>> _______________________________________________
>> MediaWiki-l mailing list
>> To unsubscribe, go to:
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l