[subscribe]
Forums -> Site Info

TG Code


This document explains what TGCode is, and how to use it to insert links, pictures, and to format your text on TerraGenesis.

What is TGCode?
You've probably seen BBCode on other forums; it's a set of tags that you can use in forum posts to insert links, images, and to change the format of your text. Here on Terragenesis we've created our own codes because we wanted to implement a single system for use in all areas of the site, not just the forum.

Why don't you just use HTML?
Firstly because HTML can be problematic in that, if you get it wrong, it can mess up the whole page from that point on. It's safer to use a system where we can protect against this. Secondly, because our own tagging system is simpler and easier to use. And finally because the standards and syntax for HTML had changed in the past and probably will again. Using our own codes means that any changes to the HTML standards merely require a change to our code translator, rather than a major data editing exercise.

Where can I used TGCode?
At the moment you can use TGCodes in: forum posts, the additional information section of your profile, and competition entry texts. It will be implemented in other areas in due course.

What TGCode tags can I use?
Read on:

TGCode Tags

Subtitles

You can create subtitles like the ones above by underlining the title text with a row of = signs or - characters. The text "TGCode Tags" (above) is underlined with = signs and is an HTML <h2> heading while "Subtitles" is underlined with - characters and is an <h3> heading. Note that you can't created <h1> headings as these are system generated from data such as topic titles.

Do not use them to emphasise your text in forum posts. Doing so will be regarded as an abuse and you will be taken out and shot.

Bold & Italics

You can make bold text by putting a pair of * characters at the start and end of the text to be make bold. Italicised text is achieves using pairs of / characters. Opinion seems to vary with regard to when these are appropriate. I, as the Site Administrator, don't intend to lay down hard and fast rules about when the can/should be used on the forum. However I do, intend to lay down rules about their use in "wiki" articles... so watch this space.

Image 20120202154446

Bullet Points

  • These are supported.
  • Just put 3 spaces, an *, and another space, at the start of each line
  • Use a # characters instead of an * for a numbered list (numbering is done for you by the system).

Note that you need to have a blank line before the first bullet point. An explanation of why that is necessary and a few other examples of things you can do with bullet points can be found here

Image Tags

The posting editor has a mechanism that allows you to upload images from you computer or from another site. It will create a tag for you. The mechanism also allows you to insert images from our gallery... and again, it will create the tag for you. However it is worth having a little understanding of the tags.

Most tags are in the format [img_J=I|C] where:

J is either l, r, or c, to left justify, right justify, or centre the image.
I is the image id (created when it's uploaded to TG).
C is a caption for the image.

There are two variations to this format:

The first omits the _J part of it. These images have no justification or centring but can be used within centring tags. This would be pointless for a single image (just use the img_c instead) but can be used to centre two smaller images by enclosing them both with centring tags.

The second variation has an additional parameter: [img_J=I|C|L] where L can be either:

  1. a url (to link to an off-site resource). This type of tag is created when you upload an image from another site; it links to the original off-site resource.

  2. a gallery image id. This type of tag is created when you create a link to a gallery image; the link links to the image in the gallery (where you can see the description and other information).

There is final 'trick' that you should know about which is that if you put two or more centred gallery image tags on consecutive lines, thus:

[img_c=I|C|L]
[img_c=I|C|L]
[img_c=I|C|L]

Rather than displaying them full size, they will be displayed as thumbnails which link to the full sized images. Note that this trick only works with centred gallery image tags.

Link Tags

The posting editor has a mechanism for creating links and there are two types.

[link=url|text] tags are for linking to external resources i.e. pages on other sites. It needs a url (beginning with http://) and a piece of text to be used as the highlighted link.

All of the other link tags, and there are several, are for linking to on site resources such as topics, posts, competition entries, etc. In each case the tag needs a resource id and a piece of text to use as the highlighted link.

Note that you could use the [link=url|text] tag to link to other pages on TG but its better to use one of the internal link tags as these will not break if this physical location of the resource changes... and I do move them from time to time, especially the gallery images, to break links from other sites and prevent them from stealing our bandwidth.


Forums -> Site Info