Template:Talkspace detect/sandbox: Difference between revisions

Content deleted Content added
Copying the code from the main template.
 
Making it fully compatible with the other namespace detection templates.
Line 1:
{{#switch:
{{#ifeq:{{NAMESPACE}}|{{TALKSPACE}}
{{lc: <!--Lower-case the result-->
| {{#switch:{{NAMESPACE}}
<!--If no or empty "demospace" parameter then detect namespace-->
| Talk = {{{main|{{{default|}}}}}}
| User talk = {{{user|#if:{{{defaultdemospace|}}}}}}
| Wikipedia talk =| {{{wikipedia|{{{default|}}}demospace}}}
| File talk =| {{#ifeq:{file{NAMESPACE}}|{{{default|}}}}SUBJECTSPACE}}
| subject
| MediaWiki talk = {{{mediawiki|{{{default|}}}}}}
| Template talk = {{{template| {{{default|}}}}TALKSPACE}}
}}
| Help talk = {{{help|{{{default|}}}}}}
}}
| Category talk = {{{category|{{{default|}}}}}}
| Portal talk = {{{portal|{{{default|}}}}}}
| #default = {{{default|}}}
}}
<!-- Only one of the lines below will be executed -->
| {{{other|}}}
<!-- Respecting empty parameters on purpose -->
}}<noinclude>
| main
| user
| project <!-- project = wikipedia -->
| wikipedia
| image <!-- image = file -->
| file
| mediawiki
| template
| help
| category
| portal
| subject | Talk = {{{mainsubject| {{{defaultother|}}} }}}
 
| talk = {{{talk| {{{other|}}} }}}
| user talk = {{{user talk| {{{other|}}} }}}
| project talk
| wikipedia talk = {{{wikipedia talk| {{{project talk| {{{other|}}} }}} }}}
| image talk
| file talk = {{{file talk| {{{image talk| {{{other|}}} }}} }}}
| MediaWikimediawiki talk = {{{mediawiki talk| {{{defaultother|}}} }}}
| template talk = {{{template talk| {{{other|}}} }}}
| Helphelp talk = {{{help talk| {{{defaultother|}}} }}}
| Categorycategory talk = {{{category talk| {{{defaultother|}}} }}}
| Portalportal talk = {{{portal talk| {{{defaultother|}}} }}}
| {{{other|}}}
| #default = {{{other|}}} <!--"demospace=other" or a new talkspace-->
 
}}<!--End switch--><noinclude>