Advanced uses of Tags

Tags are a very powerful tool to organise your world, but there are a couple use cases you might not have thought off. If you've browsed my world previously, you might not even notice me using tags, but behind the scenes, many things are automated using tags. They provide a way for me to generated automated indices (e.g. Index and Cities & Settlements) or more cross linking fields on my settlements and deities.
 

Basics

I won't go in depth on the basics of the tagging system, as there is already an amazing Codex article about that. But in short, they are a way to
  1. categoriese your articles in addition to categories
  2. mark your articles to be included by various features of WA (diplomancy webs, tagged lists...)
 

Tag based Content

Grandmaster+
This is a way to show and hide messages, depending on the tags you put on your article. This will cut down on copy-pasting the message from one article to another. Just add the tag, and the message will appear automatically.
  Usecases:
  • Automatically show a "This is a stub" or "This article is still under construction" message on your articles, just by tagging them "stub" or "wip"
  • Automatically add trigger warnings, just by adding a tag, which you might be already using for categorisation anyways.
WorldAnvil features:
  • You can add Global Content to every article in your world.
  • You can show and hide specific content with css
  • Every tag is added as a css class to your article

Step 1: Add your global content
You can find various global fields in your world settings under Settings > Display > Global Content, which show up on every article in your world. For this we will be using the GLOBAL ARTICLE ANNOUNCEMENTS BLOCK (SIDEBAR TOP) field, so scroll down a bit until you find it.   In here define a container for every tag you want to use. All these containers need one general css class tag-info and one specific to the tag you want to use tag-info-<customtag>.  
[container:tag-info tag-info-stub]
	<Your Content>
[/container]
GlobalArticleAnnouncementsForTags.png

Step 2: Add the CSS
.user-css .world-global-annnouncement .tag-info{
  display: none !important;
}
.user-css.tag-stub .world-global-annnouncement .tag-info-stub{
  display: block !important;
}
The Css uses two pieces. First we will have to hide all tag based content containers, so they don't show up when we don't need them.
Then we will add a seperate block for each tag based content container we want to use. Replace the bold parts with your own tag if you want to use different ones.
 

Index / Glossary

This will give you a single article in your world, which lists all other articles in alphabetical order. This is a very nice way for people to find things in your world, or just browse it for random content.
Example: Index
 

Simple Glossary

The idea behind this is actually pretty simple. Tagged lists can pull all articles with a specific tag, and will list them in alphabetical order. To format our Glossary a bit better, we will use one tag per starting letter. So in the end we will tag every article starting with an 'A' with the tag 'idx-a', every article starting with a 'B' with 'idx-b' and so on.  
Step 1: Copy the Glossary BBCode into a new generic article in your world
Hint: The world anvil search includes tags. Usually this is a very useful feature, but for our usecase this is counter productive as we will have to tag every article in the world. To mitigate this, I recommend using tags you will not search after. This is the reason why I named all tags below 'idx-b' instead of 'index-b'
[row]
  [col3][tagged:idx-a|list|A][/col3]
  [col3][tagged:idx-b|list|B][/col3]
  [col3][tagged:idx-c|list|C][/col3]
[/row]
[row]
  [col3][tagged:idx-d|list|D][/col3]
  [col3][tagged:idx-e|list|E][/col3]
  [col3][tagged:idx-f|list|F][/col3]
[/row]
[row]
  [col3][tagged:idx-g|list|G][/col3]
  [col3][tagged:idx-h|list|H][/col3]
  [col3][tagged:idx-i|list|I][/col3]
[/row]
[row]
  [col3][tagged:idx-j|list|J][/col3]
  [col3][tagged:idx-k|list|K][/col3]
  [col3][tagged:idx-l|list|L][/col3]
[/row]
[row]
  [col3][tagged:idx-m|list|M][/col3]
  [col3][tagged:idx-n|list|N][/col3]
  [col3][tagged:idx-o|list|O][/col3]
[/row]
[row]
  [col3][tagged:idx-p|list|P][/col3]
  [col3][tagged:idx-q|list|Q][/col3]
  [col3][tagged:idx-r|list|R][/col3]
[/row]
[row]
  [col3][tagged:idx-s|list|S][/col3]
  [col3][tagged:idx-t|list|T][/col3]
  [col3][tagged:idx-u|list|U][/col3]
[/row]
[row]
  [col3][tagged:idx-v|list|V][/col3]
  [col3][tagged:idx-w|list|W][/col3]
  [col3][tagged:idx-x|list|X][/col3]
[/row]
[row]
  [col3][tagged:idx-y|list|Y][/col3]
  [col3][tagged:idx-z|list|Z][/col3]
[/row]
Step 2: Tag all your articles
Hint: If you want to have a more complex Glossary / Index system, skip this step for now and read the section below. Now you will have to go through all your articles and tag them accordingly. After you've done that, your Glossary page should now show every article.

Comments

Please Login in order to comment!
Powered by World Anvil