Last modified: 2012-04-16 09:15:34 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T28113, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26113 - Allow to limit transclusion by namespace ({{#ifeq:{{NAMESPACE}}|{{ns:0}}|<onlyinclude>}})
Allow to limit transclusion by namespace ({{#ifeq:{{NAMESPACE}}|{{ns:0}}|<onl...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
unspecified
All All
: Low major (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.mediawiki.org/wiki/Help:Te...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-25 04:28 UTC by User:Docu
Modified: 2012-04-16 09:15 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description User:Docu 2010-11-25 04:28:44 UTC
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.
Comment 1 Bawolff (Brian Wolff) 2010-11-26 18:47:12 UTC
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...
Comment 2 User:Docu 2010-11-26 22:55:47 UTC
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).
Comment 3 db [inactive,noenotif] 2011-06-21 17:21:51 UTC
related: bug 9584

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links