Link Shortcuts in Articles and News Items


As a website editor, you can use shortcuts to quickly produce links to resources (such as articles, downloads, images, games and more) when authoring news items and articles. In some cases, shortcuts can automatically retrieve information from the database and add it to the link, saving you the trouble of typing it yourself.

All shortcuts follow the same general pattern, starting with an opening square bracket, then three capital letters (which identify the type of resource), followed by a colon and (usually) an integer (identifying the particular resource), followed by further colon-separated options to specify such things as the text of the link or the width of an image. For example:

[ART:451]

The 3-letter code ART identifies the resource as an article and the number is its ID (the same number visible in your browser's address bar when the article is displayed). Since, in this example, no link text is specified, the database is queried for the article title and the HTML produced is:

<a href="/articles/451">What's New</a>

You can still type the whole HTML link out by hand if you wish, or use the equivalent Markdown, which is:

[What's New](/articles/451)

and both will produce exactly the same link on the page, but using shortcuts is generally quicker and less error prone. In addition, shortcuts can help detect certain types of errors. For example if you were to enter a non-existent ID for a download:

[DLD:99999]

In this case the database would be consulted, the invalid ID detected and a message displayed prompting you to correct the error.

ART: Article

The code for an article link is ART and an ID is required. The only option is the link text, which follows the ID.

[ART:123:Further details]

If it's missing then the article title from the database is used.

[ART:123]

CAL: Calendar Event

The code for a calendar event link is CAL and an ID is required. The only option is the link text, which follows the ID.

[CAL:123:For your diary]

If it's missing then the name of the event from the database is used.

[CAL:123]

DLD: Download

The code for a downlaod link is DLD and an ID is required. The only option is the link text, which follows the ID.

[DLD:123:full report]

If it's missing then the single word "download" is used.

[DLD:123]

EMA: Emails Address

This shortcut is less about saving typing and more to do with hiding email addresses from automated harvesting programs under the control of spammers. You should always use it instead of inserting raw HTML email links. The code to use is EMA and, unlike most other shortcuts, you specify an email address rather than a database ID. An example is:

[EMA:[email protected]]

which would produce the following HTML:

<script>liame('vr<\057n>', 'vr">frpergnel\100vph', '<n uers="znvygb:frpergnel\100vph')</script>

This may not look much like an email link but, thanks to some JavaScript embedded in ICU web pages, it is, believe it or not, exactly equivalent to:

<a href="mailto:[email protected]">[email protected]</a>

As you can imagine, the spammers would have a hard time extracting an email address from that! There is one option for the link text. If you don't specify any, then the email address is used (as in the above example). Here's the same example but with the link text explicitly set:

[EMA:[email protected]:ICU Secretary]

EVT: Calendar Event

EVT is an alias for CAL and works the same way.

EXL: External Links

It's good practice to add a target attribute to links that would take the user to an external site. For example:

<a href="https://chess24.com/en" target="external">Chess24</a>

This prevents the page containing the link being replaced and instead causes the browser to open a new window or tab in which to display the linked page.

However, Markdown can only generate simple links and doesn't have the ability to add custom attributes. You could write the link out in full, as it's possible to embed snippets of pure HTML within markdown, or you could use the EXL shortcut. So, for example, the above link could also be produced as follows:

[EXL:https://chess24.com/en:Chess24]

The colon-separated parts of this shortcut after the 3-letter code EXL are in order:

  1. the URL scheme (either http or https),
  2. the rest of the URL (which must begin with 2 forward slashes),
  3. optional link text (if absent a shortended version of the URL will be used),
  4. an optional target name specified in the form target=name (if absent the default value external will be used).

Another example:

[EXL:http://ulsterchess.org/:target=provinces]

would produce:

<a href="http://ulsterchess.org/" target="provinces">ulsterchess.org</a>

FEN: Chess Diagram

⇧ White to play and win

This shortcut (the code for which is FEN) doesn't produce a link, rather it embeds a static chess diagram in the page with some optional text. Unlike most of the other shortcuts, it doesn't use the ID of a database record but instead requires a specification of the chess position using Forsyth–Edwards Notation. For example, here is how to show the Lucena position:

[FEN:1K1k4/1P6/8/8/8/8/r7/2R5 w - - 4 1]

You can specify the entire FEN code if you like, but since the last 4 parts (castling availability, en passant square, half-move clock and full-move number are not required to produce a diagram) you can omit them:

[FEN:1K1k4/1P6/8/8/8/8/r7/2R5 w]

There are two options, the first is for board position. If you specify:

The second option is for a short comment, which will be left blank if you don't specify one. Putting all this together, here's an example showing how to produce a diagram of the Lucena position floated to the right with a comment (just like the diagram you can see here):

[FEN:1K1k4/1P6/8/8/8/8/r7/2R5 w:right:White to play and win]

GME: Game

The code for a game link is GME and an ID is required. The only option is the link text, which follows the ID.

[GME:123:amazing game]

If it's missing then the player's names from the database are used, as in this example:

[GME:20838]

which would produce the HTML link:

<a href="/games/20838">Orr, Mark-Bologan, Viktor</a>

If the special value "*_*" is given for the link text,

[GME:20838:*-*]

then the result of the game from the database is used (rather than the player names):

<a href="/games/20838">1-0</a>

IMG: Image

New (in 2011) ICU website logo adapted (by Mark Orr) from the original black and white version (image 164)

The code IMG is not used for links but to embed images in the page (as shown to the right). For links to images, see Image Links (IML), below.

[IMG:123]

If you specify no options (as in the example above) you get all the defaults, which are:

To make the image float right, instead of left, then specify right as one of the (colon-separated) options. To center it (and not have text flow around it) specify center.

Unless an image is quite small, you probably don't want to have it display in full size, especially in a news item. To alter the size of an image, specify an explict width or height. For example, the natural size of the ICU logo (image ID 619) is 600x600. The reduced size image displayed on the right was produced by:

[IMG:619:width=250:right]

Specifying "width=100" not only reduces the width, but reduces the height in the same proportion. The same effect could equally have been acheived by altering the height instead ("height=250").

A left (right) margin is applied by default if the image is floated right (left). The only time you might not want a margin is if you want to float multiple small images left or right and don't want gaps betweem them. In this case, specify "margin=no" for all images floated to one side except the last one. You can see the technique in action in this news item.

To explicity specify the alt text (instead of defaulting to the image caption from the database) just add a colon and then the text:

[IMG:123:Philip Short]

IML: Image Link

The code for producing a link to an image is IML and an ID is required. The only option is the link text, which follows the ID.

[IML:123:full resolution image]

If it's missing then the single word "image" is used.

[IML:123]

NWS: News

The code for a news item link is NWS and an ID is required. The only option is the link text, which follows the ID.

[NWS:123:Announcement]

If it's missing then the news item headline from the database is used.

[NWS:123]

PGN: Game

PGN is an alias for GME and works the same way.

RTN: Rated Tournament

This shortcut produces links on the ICU ratings site (not this site) and it's preferable to use this rather than TRN for a cross table, unless the ratings site doesn't have the one you want (for example, if it's a rapid tournament). The code for a rated tournament link is RTN and an ID is required. The only option is the link text, which follows the ID.

[RTN:123:cross table]

If it's missing then the you specified is used instead. For example:

[RTN:123]

produces the HTML link:

<a href="http://ratings.icu.ie/tournaments/123">123</a>

TRN: Tournament

The code for a tournament link is TRN and an ID is required. The only option is the link text, which follows the ID.

[TRN:123:cross table]

If it's missing then the tournament name from the database is used.

[TRN:123]

Now that we have the ratings site, it's preferable to use links to it's cross tables with RTN.

© 2004-2024 Irish Chess Union ● Contact UsPrivacy Policy