Difference between revisions of "Help:Using Templates and HTML in Note Fields"

From ISFDB
Jump to navigation Jump to search
(→‎Linking Templates: straight correction (not full name but short name); clear identification of link target [HAVING checked the 14 templates that take no parameter])
(→‎Linking Templates: Added LTF-title and LTF-pub)
Line 107: Line 107:
 
| Links to the home page of The Locus Index to Science Fiction
 
| Links to the home page of The Locus Index to Science Fiction
 
|
 
|
 +
|-
 +
| LTF-title
 +
| Links to a La Tercera Fundación title using its using "ficha" (title) number
 +
| <nowiki>{{LTF-title|46395}}</nowiki>
 +
|-
 +
| LTF-pub
 +
| Links to a La Tercera Fundaci&#243;n publication using its "libro" (publication) number
 +
| <nowiki>{{LTF-pub|50465}}</nowiki>
 
|-
 
|-
 
| Miller/Contento
 
| Miller/Contento

Revision as of 18:05, 13 June 2018

This page is a help or manual page for the ISFDB database. It describes standards or methods for entering or maintaining data in the ISFDB database, or otherwise working with the database. Other help pages may be found via the category below. To discuss what should go on this page, use the talk page.

If, after exploring the Help system, you still have a question, please visit the Help desk and let us know. We probably know the answer, but we need your help to know what we left out of the help pages.

If you are new to editing the ISFDB, please see Help:Getting Started.

For more on this and other header templates, see Header templates.


All ISFDB records include a note field. Note fields support a number of templates and limited use of HTML.

Templates

Note that this section covers the ISFDB templates which can be used in the Notes field of ISFDB records. Some of them roughly correspond to, but are distinct from, the linking templates available within the ISFDB Wiki, which are listed on page Help:Linking templates.

Special Templates

If you enter {{BREAK}} anywhere in a Note field, everything after the {{BREAK}} will be displayed on a separate Web page, which will be linked from the main record page. ("BREAK" must be in all caps.)

Linking Templates

Most ISFDB templates are "linking templates", which means that they generate hyperlinks to other ISFDB records, ISFDB Wiki pages or third party Web pages. Linking templates are case-insensitive, e.g. "BL", "bl" and "Bl" generate the same links.

Note that when linking to a supported third party Web site by record number, the preferred method is to enter it in the "External ID" field. The use of linking templates in Notes should be limited to:

  • third party records which do not directly match the publication, e.g. "The skeleton OCLC record {{OCLC|123456}} may be related", or
  • cases where detailed information about the linked record needs to be provided, e.g. "Page count from {{BNB|011585872}}".

At this time the following linking templates are supported:

Template Functionality Example
A Links to an Author record within ISFDB using the author's name {{A|Jules Verne}}
ASIN Links to an Amazon.com page using an ASIN {{ASIN|B000JMLBHU}}
Audible-ASIN Links to an Audible.com page using an Audible ASIN (different from regular Amazon ASINs) {{Audible-ASIN|B002V1BVK4}}
BL Links to the British Library using a British Library system number {{BL|011388149}}
Bleiler1 Displays the short name of this bibliographic source and links to its Title record within ISFDB
Bleiler78 Displays the short name of this bibliographic source and links to its Title record within ISFDB
BNB Links British National Bibliography using a British Library system number or a BNB number {{BNB|011585872}}
BnF Links to Bibliothèque nationale de France using the last part of the BnF URL {{BnF|cb317942828}}
Clute/Grant Displays the short name of this bibliographic source and links to its Title record within ISFDB
Clute/Nicholls Displays the short name of this bibliographic source and links to its Title record within ISFDB
Contento Displays the short name of this bibliographic source and links to its Title record within ISFDB
Currey Displays the short name of this bibliographic source and links to its Title record within ISFDB
DNB Links to Deutsche Nationalbibliothek using DBN's permanent record number {{DNB|1076016375}}
FantLab Links to FantLab.ru's home page
FantLab-author Links to FantLab.ru using an author number {{FantLab-author|1105}}
FantLab-title Links to FantLab.ru using a work/title number {{FantLab-title|46395}}
FantLab-pub Links to FantLab.ru using an edition/publication number {{FantLab-pub|50465}}
JNB Links to Japanese National Bibliography using a Japanese National Bibliography number (JPNO) {{JBN|22859001}}
LCCN Links to the catalog of the Library of Congress using an LCCN {{LCCN|89040470}}
Locus1 Links to the home page of The Locus Index to Science Fiction
LTF-title Links to a La Tercera Fundación title using its using "ficha" (title) number {{LTF-title|46395}}
LTF-pub Links to a La Tercera Fundación publication using its "libro" (publication) number {{LTF-pub|50465}}
Miller/Contento Displays the short name of this bibliographic source and links to its Title record within ISFDB
NDL Links to the Japanese National Diet Library using a record number {{NDL|027806225}}
OCLC Links to WorldCat/OCLC using an OCLC number {{OCLC|880913738}}
PPN Links to De Nederlandse Bibliografie using a PPN number {{PPN|854168982}}
Publisher Links to a Publisher record within ISFDB using the name of a publisher {{Publisher|Tor}}
Reginald1 Displays the short name of this bibliographic source and links to its Title record within ISFDB
Reginald3 Displays the short name of this bibliographic source and links to its Title record within ISFDB
SFBG Links to the SFBG home page
SFBG-title Links to the SFBG using a title code {{SFBG-title|LTUS-VKR}}
SFBG-pub Links to the SFBG using an publication code {{SFBG-pub|LTUS-VKR-01RC}}
SFBG-publisher Links to the SFBG using a publisher code {{SFBG-publisher|LTUS}}
SFE3 Links to the home page of the Third edition of The Encyclopedia of Science Fiction
Tuck Displays the short name of this bibliographic source and links to its Series record within ISFDB

Non-Linking Templates

Template Functionality Example
ISBN Displays the words "Additional ISBN" followed by a space and the specified parameter {{ISBN|978-0-9953378-2-4}} will display "Additional ISBN 978-0-9953378-2-4" (Note that, unlike the corresponding Wiki template, this ISFDB template does not link to "Book sources".)
Tr Displays the words "Translated by" followed by a space and the specified parameter {{Tr|Charles Baudelaire}} will display "Translated by Charles Baudelaire"

HTML

All note fields permit HTML, Hyper Text Markup Language, to be entered as part of their text, and will display that HTML when the record is displayed in response to a database query. In theory a very wide variety of effects could be implemented in this way, but in practice only a few HTML constructs are used to avoid overly complex pages or security problems. Moderators have the option to question any HTML constructs other than those which are listed here.

This page lists the HTML constructs commonly used in ISFDB note fields, and describes how to enter them.

Conventions

On this page, HTML examples and their results are shown in light shaded background and actual tags are shown in Shaded boldface.

If you edit this page or look at the wiki source you will see code and nowiki tags being used. Those are present to allow the examples to display properly -- they should NOT be part of any HTML you enter in ISFDB note fields. In the link examples, wikicode (square brackets) is used to make the results appear correctly, since a tags do not render correctly in wiki pages. Do not enter this into ISFDB note fields, use the forms displayed using the a tags instead.

Tags and Tag Pairs (An Intro to Basic HTML)

All HTML is entered as one or more Tags. A tag starts with a "<" character, and ends with a ">" character. The opening < is followed by code for the tag, which is one or more letters (or in some cases digits). This may be followed by a space and some parameters or settings, depending on the specific tag involved.

Supported HTML tags

  • 'abbr'
  • 'b'
  • 'blockquote'
  • 'br'
  • 'caption'
  • 'center'
  • 'cite'
  • 'del'
  • 'em'
  • 'h1'
  • 'h2'
  • 'h3'
  • 'hr'
  • 'i'
  • 'li'
  • 'ol'
  • 'p'
  • 'pre'
  • 'q'
  • 's'
  • 'span'
  • 'strong'
  • 'sub'
  • 'sup'
  • 'table'
  • 'tbody'
  • 'td'
  • 'th'
  • 'tr'
  • 'u'
  • 'ul'

Tag Pairs

Most tags come in pairs, a start tag and a stop tag. The stop tag has a slash ("/") before its code. For example if there were a tag with the code "test" the start tag would be <test>, and the end tag would be </test>.

Tags may be nested, but not interleaved. For example, the following would be a valid case of nested tags:

<i>italics and <b>bold italics</b> </i>

The following is an example of INVALID interleaving of tags:

<i>italics and <b>bold italics </i> Just bold? </b>

More simply stated: if a tag pair starts inside another tag pair, it must be closed before the outer tag pair is closed.

If a tag is part of a tag pair, it is important to enter a matching end tag for each start tag. Otherwise the tag's effect may continue onto the display page beyond the note field, causing an incorrect display of the rest of the ISFDB record.

There are some cases where the closing tag of a tag pair may safely be omitted. The only one commonly used in ISFDB note fields is the <li> tag, whose closing tag is optional.

Unpaired Tags

Some tags are not part of a tag pair, and do not require a matching close tag. The most common one used in ISFDB note fields is <br>, the line break (see the following section). Such tags may end with a space and a slash (/), to indicate that they are "self-closing". However, this is strictly optional for all such unpaired tags used in ISFDB note fields. This is true in all current versions of HTML and all current browsers. Moreover, future versions of HTML are expected to continue to support the form without the closing slash, so editors may use either form in ISFDB note fields.

Line breaks

If you need to create a line break within a Note field, simply use the Enter/Return key on your keyboard. In the past it was necessary to use the HTML "break" tag, which is entered as <br /> or <br>, but this is no longer required.

Italics

To display text in italics, such as for a book title, use the i tag. This is part of a tag pair, and MUST be closed or the rest of the record will be displayed in italics.

For example, this HTML:

First published in <i>Megabook of Great SF</i> (1955)

would display like this:

First published in Megabook of Great SF (1955)

Boldface

To display text in boldface, such as for emphasis, use the b tag. This is part of a tag pair, and MUST be closed or the rest of the record will be displayed in bold.

For example, this HTML:

It is <b>very important</b> to close all tag pairs.

would display like this:

It is very important to close all tag pairs.

Unlike italics, boldface is rarely used in ISFDB note fields. The use of boldface for titles is discouraged. Although the ISFDB is not bound to any particular citation style, most of them, including the most popular one created by the MLA (Modern Language Association), require that the titles of books and magazines (container publications) be entered using italics. The titles of shorter works which are contained in publications, like essays and stories, should be entered using standard double quotes.

Links

To create and display a hypertext link, use the <a>...</a> (anchor) tag. This is a tag pair, and MUST be closed with </a>or the rest of the record may not display at all.

The <a> tag has a single parameter, href, which gives the URL (web address) of the site to link to. The URL follows an equals sign and MUST be enclosed in double quotes to work correctly. That is, the full parameter is href="URL_Here". The text between the start tag and the close tag will be shown as the NAME of the link, the text on which a user may click to follow the link. The link NAME need not be the same as the URL.

A hypertext link is most often used in an ISFDB record's note field to link the record to the Internet source from which data has been used and/or verified.

Be careful to enter only links which are relevant and useful to the record. Links to websites other than sources of data are very unusual and should be avoided. Title records now have a designated field to enter these links and HTML should not be used in this field. (But a complete URL is required.) Links in publication records should only be entered in the Note field, and HTML is required.

Only those links which are very likely to remain stable should be entered. If the link target changes, in the case of some websites that use "floating targets", it may lead a user to the wrong page. The information it was supposed to link to will not be visible to the ISFDB user, often with no easy way to find it. Of course, the editor of the record has the option of giving the source of the data without having to provide a link.

  • Links to Library of Congress (LCCN) records using their "permalinks" are stable.
  • Links to OCLC/Worldcat records by record number (preferably their "permalink") are stable.
  • Links to the BLIC (British Library Integrated Catalogue) records are stable if you use the specific URL described below and not the visible URL in your browser's address window. The visible URL is tied to the viewing session and expires when the session ID does. Enter the system number (usually found in the record's Identifier field) in the following URL, replacing 1234567890: http://explore.bl.uk/primo_library/libweb/action/search.do?&vl(freeText0)=1234567890&fn=search
  • Links to Project Gutenberg etexts by text number are stable.
  • Links to records in the Locus online database are NOT stable. Locus periodically reindexes, changing the page division points and thus the page ID for any particular reference. For this reason, links to Locus should not be entered into ISFDB note fields, as there is no way to automatically update them. Simply noting the source as "Locus1" is sufficient.

See the Linking Examples below for further information on entry and display.

If you are unsure whether a particular link or sort of link is stable, ask at the Help Desk before using it.

WARNING: You may see a target= parameter in links copied from other sites. This parameter tells the a web browser where to display the results of clicking on the link (and says nothing about what to display). DO NOT use target= in links you add to the ISFDB, as doing so may interfere with the software's display management. The link:
<a href="http://some.where.com/this.html" target="main">A Link</a>
should be entered as:
<a href="http://some.where.com/this.html">A Link</a>

Linking Examples

  • HTML link to the Library of Congress record for a specific LCCN (Library of Congress Control Number):
LCCN: <a href="http://lccn.loc.gov/77076221">77-76221</a>
would display like this:
LCCN: 77-76221
  • HTML link to a specific OCLC/Worldcat record:
OCLC: <a href="http://www.worldcat.org/oclc/88150">88150</a>
would display like this:
OCLC: 88150
Please note: searches on OCLC/Worldcat will result in URLs similar to this:
http://www.worldcat.org/title/nine-princes-in-amber/oclc/88150&referer=brief_results
which can be converted to
http://www.worldcat.org/oclc/88150
and still link to the same record. It is better to use URL obtained by clicking on the "Permalink" button/link at the top right of OCLC's pub details. Using this URL will cut down on Note field clutter.
  • HTML link to a specific BLIC (British Library Integrated Catalogue) record:
BLIC: <a href="http://explore.bl.uk/primo_library/libweb/action/search.do?&vl(freeText0)=000133672&fn=search">000133672</a>.
would be displayed as

BLIC: 000133672
Please note: DO NOT use the URL displayed in your browser's address window when searching the BLIC. They are not stable and expire at the end of your search session.
  • HTML link to a Project Gutenberg version of an ebook:
This ebook edition is available in HTML, ASCII, and iso-8859-1 formats as <a href="http://www.gutenberg.org/etext/24135">Ebook #24135</a>. Other formats may be made available in future.
would display like this:
This ebook edition is available in HTML, ASCII, and iso-8859-1 formats as Ebook #24135. Other formats may be made available in future.

Links to Other ISFDB Records

Note that although you can include links to other ISFDB records, they may not be stable over the long run as our records get merge, deleted or re-created using different record IDs. If you choose to link to another ISFDB record, avoid using the following types of links:

Unnumbered Lists

To display an unnumbered or "bulleted" list, you use two types of tags. The ul (unnumbered list) tag starts and stops the entire list, and the li (list item) tag marks off individual items in the list.

Many editors use this construct to display a series of separate notations in the note field.

The ul tag MUST be closed properly with a </ul> tag, or the rest of the record will display incorrectly as part of the list. You may see cases where the li tags do not have matching </li> tags. This will work correctly in all current web browsers and HTML versions, and the next version of the HTML standard (HTML5) explicitly permits it. Future versions of HTML are expected to support this also. Therefore closing </li> tags may be used or omitted in ISFDB note fields as each editor prefers, and there should be no difference in the resulting display.

It is possible to place one unnumbered list inside a single list item for another (outer) list. This is rarely done in ISFDB note fields, however, because (1) it is usually unnecessary, and (2) it makes editing more complex. Do not use this technique unless there is a clear need for it, and you are confident that you are closing both inner and outer lists correctly.

Examples of Lists

Here is an example of a complete unordered list.

This HTML:

<ul>
<li>Copyright 1984 by Jane Jones.</li>
<li>Cover artist credited on back cover.</li>
<li>Third printing by number line.</li>
<li>No date stated for this printing, but Locus shows it as May 1987.</li>
</ul>

would display like this:

  • Copyright 1984 by Jane Jones.
  • Cover artist credited on back cover.
  • Third printing by number line.
  • No date stated for this printing, but Locus shows it as May 1987.


Here is an example not using the closing </li> tags.

This HTML:

<ul>
<li>Copyright 1984 by Jane Jones.
<li>Cover artist credited on back cover.
<li>Third printing by number line.
<li>No date stated for this printing, but Locus shows it as May 1987.
</ul>

would also display like this:

  • Copyright 1984 by Jane Jones.
  • Cover artist credited on back cover.
  • Third printing by number line.
  • No date stated for this printing, but Locus shows it as May 1987.

It is not required that each list item starts on a new line, as shown in the examples above. The HTML will display a new line for each list item in any case. But it is easier to edit a note field when each list item tag starts a new line, and clearer what the HTML means. Most unnumbered lists in the ISFDB have been entered in this way.

HTML Entities

Some characters are reserved in HTML, and so should not be used in note fields. Instead, it is possible to use HTML Entities to display such characters.

For example, it is a very bad idea to use the less than (<) or greater than (>) signs in your note text, because the browser may mix them with tags. Even if it doesn't, error checking routines may complain about such text.

An HTML entity takes the form &entity_name; -- the and sign (&) and semicolon (;) are required. (It is also possible to use the form &#entity_number;.)

Here are some of the HTML entities that might be used in ISFDB note pages:

Partial list of HTML entities
Display Description Entity Name
< less than &lt;
> greater than &gt;
& ampersand &amp;
¢ cent &cent;
£ pound &pound;
¥ yen &yen;
euro &euro;
§ section &sect;
© copyright &copy;
® registered trademark &reg;
trademark &trade;

For more information and a longer list, see this w3schools page.