Template:index: Difference between revisions

From Thesaurus Inscriptionum Raeticarum
Jump to navigationJump to search
No edit summary
No edit summary
Line 2: Line 2:
[[description::This support template serves to create entries in '''lists of indexes'''.]] It generates a list of pages in which the title word is defined as a value of the [[Property:index]].
[[description::This support template serves to create entries in '''lists of indexes'''.]] It generates a list of pages in which the title word is defined as a value of the [[Property:index]].


In order for this to be done, this template has to be defined as the output template in [[Special:Ask|semantic queries]], using the parameter <code>template=index</code>, and the query results have to be set to plain text format by the parameters <code>mainlabel=-</code> (for no headline) and <code>?#</code> (for no links). Since only existing pages can be found by an automatic index, there has to be a page for every indexed item where index related attributes like [[Special:Categories|categories]] or the [[Property:language]] are defined.
In order for this to be done, this template has to be defined as the output template in [[Special:Ask|semantic queries]], using the parameter <code>template=index</code>, and the query results have to be set to plain text format by the parameter <code>link=none</code>. Since only existing pages can be found by an automatic index, there has to be a page for every indexed item where index related attributes like [[Special:Categories|categories]] or the [[Property:language]] are defined.


=== Usage ===
=== Usage ===
Line 14: Line 14:
(3) Call the entries with <code><nowiki>{{index|piθamnu}}</nowiki></code> (for all pages where [[piθamnu]] has been indexed):
(3) Call the entries with <code><nowiki>{{index|piθamnu}}</nowiki></code> (for all pages where [[piθamnu]] has been indexed):
:{{index|piθamnu}}
:{{index|piθamnu}}
Or call a list of entries using an inline query like <code><nowiki>{{#ask:[[Category:Word]]|mainlabel=-|?#|format=ul|template=index}}</nowiki></code> for all indexed pages of the [[:Category:Word]] (example results limited to 6):
Or call a list of entries using an inline query like <code><nowiki>{{#ask:[[Category:Word]]|link=none|format=ul|template=index}}</nowiki></code> for all indexed pages of the [[:Category:Word]] (example results limited to 6):
{{#ask:[[Category:Word]]|mainlabel=-|?#|format=ul|template=index|limit=6|searchlabel=...}}
{{#ask:[[Category:Word]]|link=none|format=ul|template=index|limit=6|searchlabel=...}}


[[Category:Text Module]]
[[Category:Text Module]]
</noinclude><includeonly>'''[[{{{1}}}]]''': {{#ask:[[index::{{{1}}}]]|mainlabel=-|?#|template=masklink|limit=1000|searchlabel= ...|default=none}}</includeonly>
</noinclude><includeonly>'''[[{{{1}}}]]''': {{#ask:[[index::{{{1}}}]]|link=none|template=masklink|limit=1000|searchlabel= ...|default=none}}</includeonly>

Revision as of 16:07, 15 June 2019

This support template serves to create entries in lists of indexes. It generates a list of pages in which the title word is defined as a value of the Property:index.

In order for this to be done, this template has to be defined as the output template in semantic queries, using the parameter template=index, and the query results have to be set to plain text format by the parameter link=none. Since only existing pages can be found by an automatic index, there has to be a page for every indexed item where index related attributes like categories or the Property:language are defined.

Usage

The code {{index|pagename}} will create a link to pagename followed by a list of all pages where pagename is indexed.

Example

(1) Create an index entry with [[index::piθamnu]] within a content page:

This is a sample text including piθamnu as indexed item.

(2) Create a page for the indexed item including relevant attributes, e.g. [[Category:Word]] (if you intend to create an index for words):

piθamnu

(3) Call the entries with {{index|piθamnu}} (for all pages where piθamnu has been indexed):

piθamnu: BZ-10.1SR-5esminu

Or call a list of entries using an inline query like {{#ask:[[Category:Word]]|link=none|format=ul|template=index}} for all indexed pages of the Category:Word (example results limited to 6):

...