Difference between revisions of "Template:Links to/doc"
imported>Cpiral (→Purpose: ce) |
imported>Cpiral (→Examples: fix one) |
||
| Line 134: | Line 134: | ||
Namespace filtering. | Namespace filtering. | ||
| − | '''What you type:'''<nowiki> | + | '''What you type:''' |
| + | {<nowiki/>{ linksto | Projects | Mediawiki | <mark>talk</mark> }} | ||
| + | {<nowiki/>{ linksto | Projects | Mediawiki | user talk }} | ||
| + | '''What you get:''' | ||
{{ linksto | Projects | Mediawiki | talk }} | {{ linksto | Projects | Mediawiki | talk }} | ||
| − | |||
| − | |||
| − | |||
{{ linksto | Projects | Mediawiki | user talk }} | {{ linksto | Projects | Mediawiki | user talk }} | ||
Revision as of 04:13, 8 December 2015
| 40px | This is a documentation subpage for Template:Links to. It contains usage information, categories and other content that is not part of the original template page. |
{{Linksto}} finds pages that link to a section. It uses the linksto search parameter to find pages, and the insource search parameter to find sections. (Note that the input to {{linksto}} is a section, while the input to the the search parameter linksto is a fullpagename.)
Contents
Purpose
Now you can use {{linksto}} to help decide when it is safe change section headings,
and safely remove {{anchor}} templates or <span id=section name>...</span>.
- Manage anchors. Assess and delete excess anchors. Move and replace anchors.
- Manage section headings. Delete section headings. Rename section headings.
While editing a section, you decide to rename its heading. Or you want to restructure an article. But it might break a link. And you're not sure about adding {{anchors}}.
- "What links here" does not report links by section name.
- This template, {{linksto}}, reports sections but does not report redirects.
- "Show redirects only" does report redirects to sections names. (It's on the What links here page).
Using these three tools, all incoming links to a section can be known.
Usage
Work from the edit page — going from it and back to it — while finding all links and redirects.[1] When entering a {{linksto|section}} copy any section name exactly as it appears in the wikitext:
== inside the heading markup =={{linksto|section heading}} or{{anchor | inside the anchor parameter }}{{linksto|anchor}} or<span id="inside the double quotes">...</span>{{linksto|span id}}
The spacing outside the name is not important, but the markup and spacing inside the name is important. The most common mistake is wrong capitalization.
Links. Taken altogether, the search links generated by this template will list all links to a section name of a page name.
Redirects. Use the "Tool" What links here. (Its on every page and every edit page.) Once there, immediately activate the "external tool" Show redirects only. If your section name is shown, your redirects are reported. Just find the wikilinks to them using What links here, and you're done. If your section is not shown in the report, no redirect at all links to your section.
These normally report zero results (or fewer than ten). For a discovered link or redirect, you must edit that page, even if it is a user page. Use an edit summary "fixing changed section name".
Basic
- {{ linksto | section }}
Linksto creates a pink box with search links inside: one to find wikilinks, one to find templates ({{Section link}}), and one to find external-style links.
- On an edit page enter a {{linksto}}.
- Preview the edit. A pink box appears with three search links inside.
- Visit each of them while learning how to proceed.
- Likewise visit the redirects report.
- Go back to your edit, and proceed.
The search link to find external-style links is currently under development.
Advanced
| 40x40px | Please don't leave a search link in an article. |
- {{ linksto | section | fullpagename }}
- {{ linksto | section | fullpagename | namespace }}
Linksto can create a triplet of, inline search links, separated by the middot · character, labeled in detail, and fit for collaboration or storage.[2]
Just add a fullpagename in parameter two. It must match the title line of the page exactly, with one, rare exception: the first character must be capitalized.
To limit search results to a namespace, use parameter three.
Parameters
Spacing does not matter around the input.
{{ linksto | 1st | 2nd | 3rd }}
1stTemplate:Space Section. Case sensitive. Matches wikitext.
2ndTemplate:Space Fullpagename. Case sensitive. Exact title.
3rdTemplate:Space namespace. Defaults to all. Accepts aliases.
Examples
| What you type | What you get | Description | |
|---|---|---|---|
| {{ linksto | Examples }} |
This is /doc. Go up to test this. |
Find all links to this section. | |
| {{ linksto | Usage }} |
This is /doc. Go up to test this. |
Find all links to this page's Usage section. |
What you type:
{{ linksto | Registers | Javanese language }}
{{ linksto | Different functions of "to be" | E-prime }}
What you get:
Javanese language#Registers: Template:Plain link · Template:Plain link
E-prime#Different functions of "to be": Template:Plain link · Template:Plain link
Namespace filtering.
What you type:
{{ linksto | Projects | Mediawiki | talk }}
{{ linksto | Projects | Mediawiki | user talk }}
What you get:
Mediawiki#Projects: Template:Plain link · Template:Plain link
Mediawiki#Projects: Template:Plain link · Template:Plain link
Reordering. If you used natural instead of most-requested order, you can number them.
What you type:
{{ linksto | wp | Wikipedia:Manual of Style | Section headings }}
{{ linksto | wp | Wikipedia:Manual of Style | Section management }}
{{ linksto | 3=wp | 2=Wikipedia:Manual of Style | 1=Section headings }}
{{ linksto | 3=wp | 2=Wikipedia:Manual of Style | 1=Section management }}
What you get:
Wikipedia:Manual of Style#Section headings: Template:Plain link · Template:Plain link
Wikipedia:Manual of Style#Section management: Template:Plain link · Template:Plain link
See also
- Help:Linking#Report links to and from a page
- Template:linksearch (talk⧼dot-separator⧽links⧼dot-separator⧽edit) finds external links
- category:search templates
Notes and references
- ↑ It is quite safe to leave the preview page by clicking a link to test a wikilink or activate the search link. (To open a new tab or window instead, press Ctrl or ⇧ Shift while following a link.)
- ↑
The actual query replaces every space with a
"[ _]", but does not show this. This mirrors the behavior and abstraction level of the wikilink.