Difference between revisions of "Template:Internal Link Popup/doc"

From Moegirlpedia
Jump to: navigation, search
m (update)
m (fix incorrect cat addition)
Line 56: Line 56:
  
 
If the page in question exists, the message changes and the page will be added to [[:Category:Pages with Unnecessary ILP]]. <code><nowiki>{{Internal Link Popup|Mainpage|foreign link}}</nowiki></code> yields {{Internal Link Popup|Mainpage|foreign link|nocat=true}}. In that case, add appropriate interlanguage link to the existing page, and do not use ILP.
 
If the page in question exists, the message changes and the page will be added to [[:Category:Pages with Unnecessary ILP]]. <code><nowiki>{{Internal Link Popup|Mainpage|foreign link}}</nowiki></code> yields {{Internal Link Popup|Mainpage|foreign link|nocat=true}}. In that case, add appropriate interlanguage link to the existing page, and do not use ILP.
[[Category:Maintenance Templates]][[Category:Informational Templates]]
+
<includeonly>[[Category:Maintenance Templates]][[Category:Informational Templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>

Revision as of 19:59, 27 August 2019

Icon-info.png
This template is a work in progress. It requires CSS style sheet support and will not work properly without changes to either your or the global common.css.

This template creates an internal link and a popup that appears when the user's mouse hover over the link, noting them that the linked page does not exist and that they may want to refer to Moegirlpedia in a different language. Workaround is used for mobile users (see below). You may also use the shortcut {{ILP}}.

Prerequisite

This template requires the following css style to work:

.popup-host .ilp-no-popup {
  display: none;
}
.popup-host .internal-link-popup {
  display: block !important;
  visibility: hidden;
  opacity: 0;
  min-width: 400px;
  font-size: 80%;
  position: absolute; top: 100%; left: 0; z-index: 999 !important;
  background-color: #fff;
  border: 1px solid #deede0;
  padding: 5px;
  border-radius: 5px;
  transition: opacity 0.5s;
  }
.popup-host:hover .internal-link-popup {
  visibility: visible;
  opacity: 1;
}
@media (hover: none){
	.popup-host .ilp-no-popup {
		display: inline;
	}
	.popup-host .internal-link-popup {
	  display: none;
	}
}
}

Until they are included in the global common.css, you will need to include them in your own common.css style sheet for this template to work correctly.

Without the stylesheet, or without a hoverable input (e.g. mobile users), the outgoing link will be shown after the internal link and no popups will appear, like this: link(zh:foreign link).

Syntax

  1. {{Internal Link Popup|link|foreign link}}
  2. {{Internal Link Popup|link|foreign link|language code}}
  3. {{Internal Link Popup|link|foreign link|language code|display=alternate display}}
  4. {{Internal Link Popup|link|foreign link|lang=language code}}
  5. {{Internal Link Popup|link|foreign link|lang=language code|status=alternate display}}

Without a specified language code, the template's default reference language will be Chinese (zh), the largest of all Moegirlpedia by far. For example, the previous code, {{Internal Link Popup|link|foreign link}}, will show up as linkThis page does not exist in English Moegirlpedia yet. You may want to refer to this page on Chinese Moegirlpedia: foreign link. (zh:foreign link).

Use display as you would the "piped" part of an internal link ([[link|THIS PART]]); {{Internal Link Popup|link|foreign link|display=alternate display}} yields alternate displayThe page "link" does not exist in English Moegirlpedia yet. You may want to refer to this page on Chinese Moegirlpedia: foreign link. (zh:foreign link).

You may specify a language code; only zh and ja is accepted, as these are the only two other language that Moegirlpedia exists in. {{Internal Link Popup|link|foreign link|ja}} will show up as linkThis page does not exist in English Moegirlpedia yet. You may want to refer to this page on Japanese Moegirlpedia: foreign link. (ja:foreign link).

If the page in question exists, the message changes and the page will be added to Category:Pages with Unnecessary ILP. {{Internal Link Popup|Mainpage|foreign link}} yields MainpageThis page does exist in English Moegirlpedia. You can still refer to this page on Chinese Moegirlpedia: foreign link. (zh:foreign link). In that case, add appropriate interlanguage link to the existing page, and do not use ILP.