https://bugzilla.wikimedia.org/show_bug.cgi?id=26113

           Summary: Allow to limit transclusion by namespace
                    ({{#ifeq:{{NAMESPACE}}|{{ns:0}}|<onlyinclude>}})
           Product: MediaWiki
           Version: wikimedia-deployment
          Platform: All
               URL: http://www.mediawiki.org/wiki/Help:Templates#Control_t
                    emplate_inclusion
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: Templates
        AssignedTo: wikibugs-l@lists.wikimedia.org
        ReportedBy: test5...@myway.com


Sample from Commons:


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

Sample in test: http://test.wikipedia.org/wiki/Template:test-a 
( http://test.wikipedia.org/w/index.php?title=Template:Test-a&oldid=91741 )


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

Sample in test: http://test.wikipedia.org/wiki/File:test-a 
( http://test.wikipedia.org/w/index.php?title=File:Test-a&oldid=91725 )


(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: http://test.wikipedia.org/wiki/Test-a 
( http://test.wikipedia.org/w/index.php?title=Test-a&oldid=91726 )


(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]]:

{{#ifeq:{{NAMESPACE}}|{{ns:0}}|<onlyinclude>}}
part of artwork template for list of works
{{#ifeq:{{NAMESPACE}}|{{ns:0}}|</onlyinclude>}} 

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.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to