Template:Region article/infobox: Difference between revisions

From Dive Atlas
Change subregion format to tree
Make parent region link go to the region form if the parent region does not exist
 
(31 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>{{#template_params:parent_region (label=Parent Region;property=Part of)}}</noinclude><includeonly>
{{#template_params:region (label=Parent Region;property=Part of)}}
<div class="regioninfobox">
</noinclude><includeonly>{| style="width: 30em; font-size: 90%; border: 1px solid #aaaaaa; background-color: #f9f9f9; color: black; margin-bottom: 0.5em; margin-left: 1em; padding: 0.2em; float: right; clear: right; text-align:left;"
{| class="wikitable" style="border:1px solid black; width:100%;"
! style="text-align: center; background-color:#ccccff;" colspan="2" |<span style="font-size: larger;">{{PAGENAME}}</span>
!colspan="2" |<span style="font-size: larger;">{{PAGENAME}}</span>
|-
|-
! Parent Region
! Parent Region
| [[Part of::{{{region|}}}]]
| {{#formredlink:target={{{parent_region|}}}|form=Region}}
|-
|-
! Subregions
! Subregions
|{{#ask:[[Part of::{{SUBJECTPAGENAME}}]]|format=tree}}
|{{#ask:[[Part of::{{SUBJECTPAGENAME}}]] [[Category:Region]]|format=ul}}
|-
! Dive sites in this region
|{{#ask:[[-Contains item::{{SUBJECTPAGENAME}}]] [[Category:Dive sites]]|format=count}}
|}
|}
 
</div>
{{IsPartOf|{{{parent_region}}}}}
[[Category:Region]]
[[Category:Region]]
<div id="contains-item-hack" aria-hidden="true" style="display: none">
<!-- This hacky query has the effect of setting the property "Contains item" on every item in the "part of" hierarchy below this page -->
{{#ask: [[Part of::+]]
|format=tree
|parent=Part of
|root={{FULLPAGENAME}}
|link=none
|template=InheritanceTreeFormat
|limit=5000
}}
</div>
</includeonly>
</includeonly>

Latest revision as of 01:59, 2 May 2025

This is the "Region article/infobox" template.

It should be called in the following format:

{{Region article/infobox
|parent_region=
}}

Edit the page to see the template text.