Template:United States topic: Difference between revisions

From WikiMD's Wellness Encyclopedia

No edit summary
No edit summary
 
Line 1: Line 1:
<includeonly>
<div class="navbox" style="border:1px solid #aaa; width:100%; background:#f9f9f9; margin:auto; clear:both; font-size:88%; text-align:center;">
<div style="padding:0.5em;">
<strong>{{{name|United States topic}}}</strong>
<!-- States -->
<div class="navbox-group">
<strong>States</strong>
<ul>
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Alabama">List of hospitals in Alabama</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Alaska">List of hospitals in Alaska</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Arizona">List of hospitals in Arizona</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Arkansas">List of hospitals in Arkansas</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}California">List of hospitals in California</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Colorado">List of hospitals in Colorado</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Connecticut">List of hospitals in Connecticut</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Delaware">List of hospitals in Delaware</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Florida">List of hospitals in Florida</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Georgia">List of hospitals in Georgia</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Hawaii">List of hospitals in Hawaii</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Idaho">List of hospitals in Idaho</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Illinois">List of hospitals in Illinois</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Indiana">List of hospitals in Indiana</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Iowa">List of hospitals in Iowa</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Kansas">List of hospitals in Kansas</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Kentucky">List of hospitals in Kentucky</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Louisiana">List of hospitals in Louisiana</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Maine">List of hospitals in Maine</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Maryland">List of hospitals in Maryland</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Massachusetts">List of hospitals in Massachusetts</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Michigan">List of hospitals in Michigan</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Minnesota">List of hospitals in Minnesota</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Mississippi">List of hospitals in Mississippi</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Missouri">List of hospitals in Missouri</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Montana">List of hospitals in Montana</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Nebraska">List of hospitals in Nebraska</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Nevada">List of hospitals in Nevada</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}New_Hampshire">List of hospitals in New Hampshire</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}New_Jersey">List of hospitals in New Jersey</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}New_Mexico">List of hospitals in New Mexico</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}New_York">List of hospitals in New York</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}North_Carolina">List of hospitals in North Carolina</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}North_Dakota">List of hospitals in North Dakota</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Ohio">List of hospitals in Ohio</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Oklahoma">List of hospitals in Oklahoma</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Oregon">List of hospitals in Oregon</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Pennsylvania">List of hospitals in Pennsylvania</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Rhode_Island">List of hospitals in Rhode Island</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}South_Carolina">List of hospitals in South Carolina</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}South_Dakota">List of hospitals in South Dakota</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Tennessee">List of hospitals in Tennessee</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Texas">List of hospitals in Texas</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Utah">List of hospitals in Utah</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Vermont">List of hospitals in Vermont</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Virginia">List of hospitals in Virginia</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Washington">List of hospitals in Washington</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}West_Virginia">List of hospitals in West Virginia</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Wisconsin">List of hospitals in Wisconsin</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Wyoming">List of hospitals in Wyoming</a></li>}}
</ul>
</div>
<!-- Insular Areas -->
<div class="navbox-group">
<strong>Insular Areas</strong>
<ul>
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}American_Samoa">List of hospitals in American Samoa</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Guam">List of hospitals in Guam</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Northern_Mariana_Islands">List of hospitals in Northern Mariana Islands</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Puerto_Rico">List of hospitals in Puerto Rico</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}US_Virgin_Islands">List of hospitals in U.S. Virgin Islands</a></li>}}
</ul>
</div>
<!-- Outlying Islands -->
<div class="navbox-group">
<strong>Outlying Islands</strong>
<ul>
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Baker_Island">List of hospitals in Baker Island</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Howland_Island">List of hospitals in Howland Island</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Jarvis_Island">List of hospitals in Jarvis Island</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Johnston_Atoll">List of hospitals in Johnston Atoll</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Kingman_Reef">List of hospitals in Kingman Reef</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Midway_Atoll">List of hospitals in Midway Atoll</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Navassa_Island">List of hospitals in Navassa Island</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Palmyra_Atoll">List of hospitals in Palmyra Atoll</a></li>}}
{{#if:{{{prefix|}}}|<li><a href="{{{prefix|}}}Wake_Island">List of hospitals in Wake Island</a></li>}}
</ul>
</div>
</div>
</div>
</includeonly>
<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage -->
</noinclude>
Explanation:
States, Insular Areas, Outlying Islands: Each group (States, Insular Areas, and Outlying Islands) is displayed using unordered lists (<ul>), which contains the links for each state or area.
prefix: This is dynamically used to add the prefix (for example, List of hospitals in), making the links consistent and reusable.
User Page Example: To use the template on a page, you can call it like this:
mediawiki
Copy
Edit
{{United States topic|prefix=List of hospitals in}}
This will display the links as individual items, grouped under "States," "Insular Areas," and "Outlying Islands" sections.
Notes:
The template uses the prefix parameter to generate consistent links across different sections.
For each group (States, Insular Areas, Outlying Islands), the links are grouped in <ul> to ensure they are formatted properly on the user page.
 
 
 
You said:
why not use mediawiki source code for the [[internal links]] instead of html?
ChatGPT said:
You're absolutely right! It's better to use MediaWiki's internal links rather than raw HTML links to ensure better integration with the platform's internal linking system. Using MediaWiki's source code for links allows for more consistent formatting, indexing, and tracking, as well as benefiting from features like redirects, categories, and the ability to handle special pages.
Here’s how you can modify the previous code to use MediaWiki source code for internal links instead of HTML:
Full Template Code with MediaWiki Links:
mediawiki
Copy
Edit
<includeonly>
<includeonly>
<div class="navbox" style="border:1px solid #aaa; width:100%; background:#f9f9f9; margin:auto; clear:both; font-size:88%; text-align:center;">
<div class="navbox" style="border:1px solid #aaa; width:100%; background:#f9f9f9; margin:auto; clear:both; font-size:88%; text-align:center;">

Latest revision as of 19:50, 29 April 2025