Topic on Project:Support desk

How to Embed List of All Namespace-Pages in a Wiki Page?

18
Summary by Johnywhy

This works:

{{Special:Prefixindex/Gun_Sense_Rebuttals:}}

This works identically, so whitespace is ok!

{{Special:Prefixindex/Gun Sense Rebuttals:}}

"Prefix" simply means "beginning of a wiki page-name".

The colon is just part of the wiki page-name. Mediawiki namespace-features interpret a colon in a page-name as a namespace delimiter.

Johnywhy (talkcontribs)

When i move a page to a custom namespace, then it's no longer listed in

{{Special:AllPages}}

How to embed list of all pages in a custom namespace?

Johnywhy (talkcontribs)

i think the answer is here, but not sure how to use it.

https://en.wikipedia.org/wiki/Template:List_subpages#Example

i don't care about prefix or user, just namespace. and i guess i'll have to learn about templates.

Ciencia Al Poder (talkcontribs)

Special:AllPages has a filter for namespace. It only displays pages in the main namespace by default.

Johnywhy (talkcontribs)

Thx, can you give a clue?

The following don't work:

{{List subpages|My_Namespace}}
{{List subpages|prefix|content namespace|caption=My_Namespace}}
{{List subpages My_Namespace}}
{{ns:My_Namespace}}
{{List My_Namespace}}
{{Special:My_Namespace}}
{{list subpages|My_Namespace|Namespace}}
{{List subpages namespace=My_Namespace}}

You said "filter", implying that, without a filter, Special:AllPages will display all pages in all namespaces. But it doesn't. The following only shows pages which are in the Main namespace:

{{Special:Allpages}}
Wargo (talkcontribs)

{{Special:Prefixindex/Namespace}} where "namespace" is your namespace.

Johnywhy (talkcontribs)

thx. Not working. I must be doing something wrong.


This page shows 2 pages in the Gun Sense Rebuttals namespace:

https://gunsense.xyz/index.php?title=Special%3APrefixIndex&prefix=&namespace=4


But those pages do not appear in This page

https://gunsense.xyz/index.php/Scrap


which contains the source below, based on your example:

{{Special:Prefixindex/Gun_Sense_Rebuttals}}


Is this a whitespace problem? The following doesn't work either:

{{Special:Prefixindex/Gun%20Sense%20Rebuttals}}

nor does:

{{Special:Prefixindex/Gun Sense Rebuttals}}

thx

Wargo (talkcontribs)

"scrap" is not in this namespace.

Johnywhy (talkcontribs)
"scrap" is not in this namespace.

why is that important?

Wargo (talkcontribs)

You need to list pages from certain namespace, right?

Johnywhy (talkcontribs)
Wargo (talkcontribs)

If it is not in namespace of interest why you would to display it? What pages you want to list?

This post was hidden by AhmadF.Cheema (history)
Ciencia Al Poder (talkcontribs)

You must add the colon:

{{Special:Prefixindex/Gun Sense Rebuttals:}}

AhmadF.Cheema (talkcontribs)

I think there is a mistake above.

{{Special:Prefixindex/Namespace}} where "Namespace" is not the namespace but actually the prefix.

Adding the colon at the end, gives the namespace pages.

Johnywhy (talkcontribs)

Bingo. This works:

{{Special:Prefixindex/Gun Sense Rebuttals:}}

This works identically, so whitespace is ok!

{{Special:Prefixindex/Gun_Sense_Rebuttals:}}
{{Special:Prefixindex/Namespace}}  where "Namespace" is not the namespace but actually the prefix.

-- Are you saying that, without colon, i need to enter a prefix someplace?

AhmadF.Cheema (talkcontribs)

I meant that without the colon, i.e. writing something like {{Special:Prefixindex/Foo}} would give all the pages whose names start with Foo.

Johnywhy (talkcontribs)

Ah, so the colon is just part of the prefix-name, and not part of any magic syntax in this embed ("transcode"?).

And a prefix-name is really just part of the wiki page-name, right? Again, not magic. But mediawiki namespace features simply interpret a colon in a page-name as a namespace delimiter, correct?

If a prefix was, say, "Foo-", for example, then i'd use

{{Special:Prefixindex/Foo-}}

In that case, namespace features would not recognize Foo as a namespace.

This post was hidden by AhmadF.Cheema (history)