Allow to limit transclusion by namespace ({{#ifeq:{{NAMESPACE}}|{{ns:0}}|<onlyinclude>}})
Open, LowPublic


Author: test5555

Sample from Commons:

(1) In template namespace there is [[Commons:Template:Artwork]].

Sample in test:
( )

(2) In file namespace descriptions use [[Commons:Template:Artwork]], e.g. [[Commons:File:Berthe_Morisot_-_Sommertag_-_1879.jpeg]].

Sample in test:
( )

(3) To display the image with part of the description in another namespace (e.g. gallery namespace) we transclude the file description with {{File:Berthe_Morisot_-_Sommertag_-_1879.jpeg}}

Sample in test:
( )

(4) The result could look like [[Commons:List_of_works:Berthe_Morisot]].

As only part of the elements from [[Commons:Template:Artwork]] should get transcluded, I'd like to limit what gets transcluded by adding the below to [[Commons:Template:Artwork]]:

part of artwork template for list of works

This doesn't work as <onlyinclude> is probably read before the other elements. (Maybe this sample should use ns:6, but that doesn't work either). Maybe there is a better way to do this.

Obviously, the layout of artwork would change too, but this should be easy to fix.

Version: unspecified
Severity: major


bzimport set Reference to bz26113.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Nov 25 2010, 4:28 AM

Why not do:
{{#ifeq:{{NAMESPACE}}|{{ns:0}}|Content that should be in main namespace only}}

I imagine that changing the way <onlylinclude> behaves would break things...

test5555 wrote:

The result would be the same indeed, but we would need to edit
each file description page (2) instead of just once the template (1).

related: bug 9584

Add Comment