Template:Index: Difference between revisions

From Greyhawk Wiki
Jump to navigation Jump to search
m Reverting "Usage" text
evening out split of column sizes
 
(31 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>==About this template==
<includeonly><h3>Encyclopedia Greyhawkania Index</h3>
This template should be included at the bottom of all pages, in the "References" after the last line of the bibliography. It will automatically generate a table including data from the '''Encyclopedia Grehawkania Index''' based upon the title (Topic) of the page on which it is included.
The [[Encyclopedia Greyhawkania Index]] (EGI) is based on previous work of Jason Zavoda through '08, continued by numerous other fans. The [[Encyclopedia Greyhawkania Index|EGI]] article has a list of sources, product names, abbreviations, and a link to the full, downloadable index.  
 
''If there are no entries currently in the EGIndex database for the Topic, a blank table with no entries will be displayed, similar to that shown below at the end of this page.''
 
If you find a page with a blank table with data missing in the table, information from ''officially published sources'' can be added to the EGI to produce new lines on the table. Preview the Types and full Product names in the [[Encyclopedia Greyhawkania Index]] in order to keep entries uniform.
 
Please visit the [https://greyhawkonline.com/encyclopediagreyhawkania/database/ Edit Encyclopedia Index] page to contribute to the wiki database.
 
==Usage==
This template is typically included in the "References" section of most pages. It is usually placed ''after'' all other References, so that it populates at the bottom of the page. <br/>Other than when the Index entry needs special function to include or exclude other words in its database search, it usually looks like this:
<pre><nowiki>==References==
'''Citations'''
<references />
'''Bibliography'''
{{index}}
 
[[Categories:INSERT CATEGORY NAME]]
</nowiki></pre>
 
When included by itself, the template should typically be added as the ''last'' line under the <source enclose="none">'''Bibliography'''</source> heading'' near the ''end'' of a wiki page, just above categories.
This usage is simply:
<pre><nowiki>{{index}}</nowiki></pre>
 
If there are syntax errors due to unusual characters in the title, or the Encyclopedia Greyhawkania Index lists the Topic in an unusual way (e.g. ""Magical Arts, University of" or "Kuroth's Quill"), the actual code for the database search and table should be inserted.  <br />
Change the "TOPIC WORD HERE" and "OTHER TOPIC WORD" in the code below, ensuring the "%" symbols are kept.<br />
'''DO NOT''' use this code if the Topic is a single word and the table produces normal results by using <nowiki>{{index}}</nowiki> instead.  <br />
The code is as follows:
<pre>
{{#get_db_data:
db=index-db
|from=index_data
|where=Topic LIKE '%TOPIC WORD HERE%' AND Topic LIKE '%OTHER TOPIC WORD%'
|order by=Topic
|limit=500
|data=Description=Description,Product=Product,PageCardImage=PageCardImage, Topic=Topic, Type=Type
}}
{| class="wikitable sortable" style="width: 90%;"
! style="width: 30%"| Topic
! style="width: 10%"| Type
! style="width: 15%"| Description
! style="width: 25%"| Product
! style="width: 15%"| Page/Card/Image
{{#for_external_table:<nowiki/>
{{!}}-
{{!}} {{{Topic}}}
{{!}} {{{Type}}}
{{!}} {{{Description}}}
{{!}} {{{Product}}}
{{!}} {{{PageCardImage}}}
}}
|}
</pre>
</noinclude>
'''Encyclopedia Greyhawkania Index'''<br />
The Index is based on previous work of Jason Zavoda (also known as the [[Encyclopedia Greyhawkania Index|Zavoda Index]]) through '08, and his work as continued and updated by Eric Johnson, Richard DiIola, and numerous other fans over the years. <br />
The wiki page for the [[Encyclopedia Greyhawkania Index|EGI]] has a list of sources, full product names, abbreviations, and a link to the full, downloadable index.
Please visit the [https://greyhawkonline.com/encyclopediagreyhawkania/database/ Edit Encyclopedia Index] page to contribute to the wiki database.
 
{{#get_db_data:  
{{#get_db_data:  
db=index-db
db=index-db
|from=index_data
|from=index_data
|where=Topic LIKE '%{{PAGENAME}}%'
|{{#if:{{{exact|}}}|where=Topic='{{{title|{{PAGENAME}}}}}'|where=Topic LIKE '%{{{title|{{PAGENAME}}}}}%'}}
|order by=Topic
|order by=Topic
|limit=500
|limit=500
|data=Description=Description,Product=Product,PageCardImage=PageCardImage,Topic=Topic,Type=Type
|data=Description=Description,Product=Product,PageCardImage=PageCardImage,Topic=Topic,Type=Type
}}
}}
{| class="wikitable sortable" style="width: 90%;"
{| class="wikitable sortable" style="width: 95%;"
! style="width: 30%"| Topic  
! style="width: 25%"| Topic  
! style="width: 10%"| Type
! style="width: 15%"| Type
! style="width: 15%"| Description
! style="width: 25%"| Description
! style="width: 25%"| Product  
! style="width: 20%"| Product  
! style="width: 15%"| Page/Card/Image  
! style="width: 15%"| Page/Card/Image  
{{#for_external_table:<nowiki/>
{{#for_external_table:<nowiki/>
{{!}}-
{{!}}-
Line 81: Line 23:
{{!}} {{{PageCardImage}}}
{{!}} {{{PageCardImage}}}
}}
}}
|}</includeonly>
<noinclude>==About this template==
This template should be included at the bottom of all articles about in-setting topics or sources, in the "References" section after the last line under the Bibliography. It will automatically generate a table including data from the '''Encyclopedia Grehawkania Index''' based upon the page name (Topic) of the page on which it is included.
''If there are no entries currently in the EGIndex database for the Topic, a blank table with no entries will be displayed, similar to that shown below under "Usage".''
If you find an article with a blank table or without data in the table, the [[Encyclopedia Greyhawkania Index]] (EGI) may not have information from ''officially published sources'' or the <nowiki>{{PAGENAME}}</nowiki> may be populating the table incorrectly—see [[#Troubleshooting|Troubleshooting]] below. .
==Usage==
The template is always added to a page as the ''last'' line under the <code><nowiki>'''Bibliography'''</nowiki></code> heading'' near the ''end'' of a wiki article, just above categories.
This usage is simply:
<pre><nowiki>{{index}}</nowiki></pre>
This results in a table at the end of the page which contains product references and page numbers, displayed as below: 
<div style="border:1px solid lightgray; padding-left: 3em">{{index}}</div>
=== Full References Section ===
This template should be included at the bottom of all pages, in the "References" section of most pages. It is usually placed ''after'' all other References, so that it populates at the bottom of the page. <br/>Other than when the Index entry needs special function to include or exclude other words in its database search, it usually looks like this:  <pre><nowiki>
==References==
===Citations===
<references />
===Bibliography===
{{index}}
[[Categories:INSERT CATEGORY NAME]]
</nowiki></pre>
=== Parameters ===
;title= :The name of the article topic, only if it differs from the article's displayed name.  Use a word from the name of the article's subject.
::<code><nowiki>{{index|title=TOPICWORD}}</nowiki></code>
:This method can also be used to broaden included results relating to the Topic if other Topics include the same word; e.g. using <code><nowiki>Thrommel</nowiki></code> instead of <code><nowiki>Thrommel IV</nowiki></code> will give results including all the rulers named Thrommel.
: This method can also be used for more precise results—to narrow the result list, multiple words can be added to the search query.
::<code><nowiki>{{index|title=TOPICWORD%' AND Topic LIKE '%ANOTHERWORD}}</nowiki></code>
: ● "Topic" can be replaced with "Description" or "Type" to give different results.
: ● Either <code>"AND"</code> or <code>"OR"</code> are allowed in the query.
::<code><nowiki>{{index|title=TOPICWORD%' OR Description LIKE '%ANOTHERWORD}}</nowiki></code>
: ● "NOT" can be used to disclude or filter out some entries,
::<code><nowiki>{{index|title=TOPICWORD%' AND Topic NOT LIKE '%ANOTHERWORD}}</nowiki></code>
;exact= :
::<code><nowiki>{{index|exact=yes}}</nowiki></code>
: Used to exclude other results where the topic is included in the name, add an <code>|exact=yes</code>parameter to the template. (or <code>|exact=1</code>) . 
:This can be combined with <code>|title=</code>, as above, to show only title results with specific phrasing, omitting entries ''containing'' the title.
::<code><nowiki>{{index|title=Barrier Peaks|exact=yes}}</nowiki></code>.
:This example would return only entries where the title is exactly "Barrier Peaks", instead of also including other miscellaneous entries containing that phrase, like ''"Expedition to the Barrier Peaks"'' or ''"Horn of the Barrier Peaks"''.
=== Index table only ===
Used when the EGI introduction paragraph is not desired, for other formatting reasons.  Other parameters are used the same as above.
:<code><nowiki>{{indextableonly}}</nowiki></code>
:<code><nowiki>{{indextableonly|title=TOPICWORD}}</nowiki></code>
:<code><nowiki>{{indextableonly|title=TOPICWORD|exact=yes}}}}</nowiki></code>
== Troubleshooting ==
If there are syntax errors due to the Encyclopedia Greyhawkania Index listing the Topic in an unusual way (e.g. "Magical Arts, University of"), the <code>title</code> should be altered to get proper EGI results. 
:<code><nowiki>{{index|title=}}</nowiki></code>
For other errors, this template can also be used to eliminate these errors by using only the words of the Topic, without any unusual phrasing, etc.
:<code><nowiki>{{index|title=TOPICWORD%' AND Topic LIKE '%ANOTHERWORD}}</nowiki></code>
=== Punctuation ===
Errors may also result from punctuation or unusual characters in the Topic's name. It is possible to make the EGI ignore the apostrophe on pages with titles such as "Kuroth's Quill" or "Johydee's Mask". Use a backslash directly before an unusual character to make the table "escape" the apostrophe or unusual punctuation.
:<code><nowiki>{{index|title=TOPICWORD\'s ANOTHERWORD}}</nowiki></code>
== Examples ==
{| class="wikitable"
|-
! Page Name !! Code Example
|-
| Thrommel IV || <code><nowiki>{{index|title=Thrommel}}</nowiki></code>
|-
| Brother Milerjoi || <code><nowiki>{{index|title=Milerjoi}}</nowiki></code>
|-
|Kuroth's Quill || <code><nowiki>{{index|title=Kuroth\'s Quill}}</nowiki></code>
|-
| Battle of Karndred's Meadows || <code><nowiki>{{index|title=Karndred\'s Meadow}}</nowiki></code>
|-
| Royal Guild of Navigators || <code><nowiki>{{index|title=Navigators%' AND Topic LIKE '%Guild}}</nowiki></code>
|-
| Knights of Holy Shielding|| <code><nowiki>{{index|title=Holy Shielding, Knights of}}</nowiki></code>  or just  <code><nowiki>{{index|title=Holy Shielding}}</nowiki></code>
|-</nowiki></code>
|-
|Johydee's Mask || <code><nowiki>{{index|title=Johydee\'s Mask}}</nowiki></code> or <code><nowiki>{{index|title=Johydee%' AND Topic LIKE '%Mask}}</nowiki></code>
|-
| Dar Kesh-Anam || <code><nowiki>{{index|title=Dar Kesh\-Anam}}</nowiki></code> or <code><nowiki>{{index|title=Dar%' AND Topic LIKE '%Anam}}</nowiki></code>
|}
|}
[[Category:Citation templates]]
[[Category:Format templates]]
[[Category:Documentation]]
[[Category:Documentation pages]]
[[Category:Template documentation pages]]
</noinclude>

Latest revision as of 15:38, 21 May 2025

About this template

This template should be included at the bottom of all articles about in-setting topics or sources, in the "References" section after the last line under the Bibliography. It will automatically generate a table including data from the Encyclopedia Grehawkania Index based upon the page name (Topic) of the page on which it is included.

If there are no entries currently in the EGIndex database for the Topic, a blank table with no entries will be displayed, similar to that shown below under "Usage".

If you find an article with a blank table or without data in the table, the Encyclopedia Greyhawkania Index (EGI) may not have information from officially published sources or the {{PAGENAME}} may be populating the table incorrectly—see Troubleshooting below. .

Usage

The template is always added to a page as the last line under the '''Bibliography''' heading near the end of a wiki article, just above categories. This usage is simply:

{{index}}

This results in a table at the end of the page which contains product references and page numbers, displayed as below:

Encyclopedia Greyhawkania Index

The Encyclopedia Greyhawkania Index (EGI) is based on previous work of Jason Zavoda through '08, continued by numerous other fans. The EGI article has a list of sources, product names, abbreviations, and a link to the full, downloadable index.

Topic Type Description Product Page/Card/Image

Full References Section

This template should be included at the bottom of all pages, in the "References" section of most pages. It is usually placed after all other References, so that it populates at the bottom of the page.
Other than when the Index entry needs special function to include or exclude other words in its database search, it usually looks like this:

==References==
===Citations===
<references />
===Bibliography===
{{index}}

[[Categories:INSERT CATEGORY NAME]]

Parameters

title=
The name of the article topic, only if it differs from the article's displayed name. Use a word from the name of the article's subject.
{{index|title=TOPICWORD}}
This method can also be used to broaden included results relating to the Topic if other Topics include the same word; e.g. using Thrommel instead of Thrommel IV will give results including all the rulers named Thrommel.
This method can also be used for more precise results—to narrow the result list, multiple words can be added to the search query.
{{index|title=TOPICWORD%' AND Topic LIKE '%ANOTHERWORD}}
● "Topic" can be replaced with "Description" or "Type" to give different results.
● Either "AND" or "OR" are allowed in the query.
{{index|title=TOPICWORD%' OR Description LIKE '%ANOTHERWORD}}
● "NOT" can be used to disclude or filter out some entries,
{{index|title=TOPICWORD%' AND Topic NOT LIKE '%ANOTHERWORD}}
exact=
{{index|exact=yes}}
Used to exclude other results where the topic is included in the name, add an |exact=yesparameter to the template. (or |exact=1) .
This can be combined with |title=, as above, to show only title results with specific phrasing, omitting entries containing the title.
{{index|title=Barrier Peaks|exact=yes}}.
This example would return only entries where the title is exactly "Barrier Peaks", instead of also including other miscellaneous entries containing that phrase, like "Expedition to the Barrier Peaks" or "Horn of the Barrier Peaks".

Index table only

Used when the EGI introduction paragraph is not desired, for other formatting reasons. Other parameters are used the same as above.

{{indextableonly}}
{{indextableonly|title=TOPICWORD}}
{{indextableonly|title=TOPICWORD|exact=yes}}}}

Troubleshooting

If there are syntax errors due to the Encyclopedia Greyhawkania Index listing the Topic in an unusual way (e.g. "Magical Arts, University of"), the title should be altered to get proper EGI results.

{{index|title=}}

For other errors, this template can also be used to eliminate these errors by using only the words of the Topic, without any unusual phrasing, etc.

{{index|title=TOPICWORD%' AND Topic LIKE '%ANOTHERWORD}}

Punctuation

Errors may also result from punctuation or unusual characters in the Topic's name. It is possible to make the EGI ignore the apostrophe on pages with titles such as "Kuroth's Quill" or "Johydee's Mask". Use a backslash directly before an unusual character to make the table "escape" the apostrophe or unusual punctuation.

{{index|title=TOPICWORD\'s ANOTHERWORD}}

Examples

Page Name Code Example
Thrommel IV {{index|title=Thrommel}}
Brother Milerjoi {{index|title=Milerjoi}}
Kuroth's Quill {{index|title=Kuroth\'s Quill}}
Battle of Karndred's Meadows {{index|title=Karndred\'s Meadow}}
Royal Guild of Navigators {{index|title=Navigators%' AND Topic LIKE '%Guild}}
Knights of Holy Shielding {{index|title=Holy Shielding, Knights of}} or just {{index|title=Holy Shielding}}
Johydee's Mask {{index|title=Johydee\'s Mask}} or {{index|title=Johydee%' AND Topic LIKE '%Mask}}
Dar Kesh-Anam {{index|title=Dar Kesh\-Anam}} or {{index|title=Dar%' AND Topic LIKE '%Anam}}