Advanced uses of Tags

This article is depicting a potential future of this world. Some events in here might not have happened yet and will be changed by the actions of the players involved in this world. Until these campaigns have concluded, this article will exist in a superposition between existance and non-existance.   Some version of this article will survive, but who knows what it will be when all of this is over
This is a stub

This article will be expanded upon in the future

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 generate 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 use case this is counterproductive 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.  

Complex Glossary

When your world grows bigger and bigger, a simple Glossary might not be enough to help your readers easily find your articles. Having articles sorted by types in addition to one big Glossary might be very useful for you.   To understand how this works, you need to understand one fundamental thing about tagged lists. Tagged list do not just grab each article with a specific tag, but they do a "contains" check. For example, if you tag an article with #article #character, a list using either #article or #character will show this article. But it goes even further. If you tag an article with #index-character, both #index and #index-character will match. And this is what we'll be using to generate more complex glossaries.  
Step 1: Decide on which additional Glossaries you want to use
First you'll have to decide, which additional Glossaries you want to have. Maybe you want to have an extra glossary for your characters, or for every tavern in your world? Maybe a list of all settlements?   Either way, make a list and note down an identifier you want to use for each glossary. In this example, I will create a Glossary for all characters in my world, using the short-form char as an identifier. As this glossary will include fewer links than the last one, I will use a slightly different layout.  
Step 2: Create the glossary
[row]
[col3]
[center][hr][h3]A-C[/h3][/center]
[tagged:idx-a-char|list|none]
[tagged:idx-b-char|list|none]
[tagged:idx-c-char|list|none]
[/col3]
[col3]
[center][hr][h3]D-F[/h3][/center]
[tagged:idx-d-char|list|none]
[tagged:idx-e-char|list|none]
[tagged:idx-f-char|list|none]
[/col3]
[col3]
[center][hr][h3]G-I[/h3][/center]
[tagged:idx-g-char|list|none]
[tagged:idx-h-char|list|none]
[tagged:idx-i-char|list|none]
[/col3]
[/row]
[row]
[col3]
[center][hr][h3]J-L[/h3][/center]
[tagged:idx-j-char|list|none]
[tagged:idx-k-char|list|none]
[tagged:idx-l-char|list|none]
[/col3]
[col3]
[center][hr][h3]M-O[/h3][/center]
[tagged:idx-m-char|list|none]
[tagged:idx-n-char|list|none]
[tagged:idx-o-char|list|none]
[/col3]
[col3]
[center][hr][h3]P-R[/h3][/center]
[tagged:idx-p-char|list|none]
[tagged:idx-q-char|list|none]
[tagged:idx-r-char|list|none]
[/col3]
[/row]
[row]
[col3]
[center][hr][h3]S-U[/h3][/center]
[tagged:idx-s-char|list|none]
[tagged:idx-t-char|list|none]
[tagged:idx-u-char|list|none]
[/col3]
[col3]
[center][hr][h3]V-W[/h3][/center]
[tagged:idx-v-char|list|none]
[tagged:idx-w-char|list|none]
[/col3]
[col3]
[center][hr][h3]X-Z[/h3][/center]
[tagged:idx-x-char|list|none]
[tagged:idx-y-char|list|none]
[tagged:idx-z-char|list|none]
[/col3]
[/row]
 
Step 3: Repeat for all glossaries you want to have
Now just repeat the process above for all the other glossaries you want to use. The amazing thing? Using tags in this way means by tagging an article with a single tag, it will show up in the correct place on your main glossary, and on the smaller glossaries as well.   But you don't have to stop there! This is nearly endlessly nestable. You want to have a glossary for all buildings, and one for every tavern? That’s really simple! Just tag all your taverns with something like #idx-a-building-tavern and you can create a glossary just checking for the building part, and one that checks for the tavern!  
Step 4: Tag all your articles!
Now go ahead and tag all your articles, and watch them magically appear on your glossary pages!  
Bonus Step 5: Create automatic links back to your glossaries!
Combining Tag Based Content, and our new Glossary system, we can easily add automatic backlinks to every glossary to every article. So when you tag an article for a glossary, the link will just appear at the end of that article!  
Step 5.1: Add the global content
Add your backlinks to your global content. You can once again find them under Settings > Display > Global Content. This time, we will use the GLOBAL COPYRIGHT FOOTER block. Repeat the second line for each index you created above.
[container:index-read-more index-read-more-title]Categories[/container]
[container:index-read-more index-read-more-char]@[Characters](article:25fed803-dd18-4051-a6af-407ffdaaaaf4)[/container]
Step 5.2: Add the css
.user-css.page .index-read-more{
display: none !important; 
}
 
.user-css.page[class*=tag-idx][class*=-char] .index-read-more-title,
.user-css.page[class*=tag-idx][class*=-char] .index-read-more-char
{
display: inline-block !important;
}
  The first block will remove every link by default. The second block then shows the correct link for each article. If you've created multiple glossaries, duplicate this block, replacing char with the key you've used.
Thanks for giving this a read!
  If you enjoy what I'm doing consider giving this a like, and let me know what you think about this article in the comments.

Comments

Please Login in order to comment!
Nov 22, 2022 14:15 by Annie Stein

Thank you so much for this guide! I didn't realize how powerful tags could be until I saw how you used them.

Creator of Solaris -— Come Explore!
Nov 24, 2022 21:20

Tags are really incredibly powerful! Glad I could help!

Want to find more of the things i'm doing? SatriumHub
Nov 24, 2022 22:25

Such a great article and very well presented! And yes tags are amazingly powerful. One of my favorite WA features.


Graylion - Nexus   Roleplaying
not Ruleplaying
not Rollplaying
Nov 26, 2022 16:46

Thank you! Yes, tags are incredibly powerful, that's why I wanted to show some ways of using them and maybe spark some ideas :)

Want to find more of the things i'm doing? SatriumHub
Nov 26, 2022 17:25 by Scott Stokes

Thank you, this article had really brought home a good reason for and use of tags. Ugg, I have nearly 1700 articles to go thorugh. I do like to stay busy, lol.

Happiness is "the exercise of vital powers, along lines of excellence, in a life affording them scope,"
Nov 28, 2022 12:29

Tags are incredibly helpful and powerful, but it's also a lot of work introducing them when you already have a lot of articles. On the other hand, once you've introduced a system that works for you, it's very little work to keep it up to date (as long as you remember tagging new things).   Hope this article was helpful to you, and if you have any more questions about anything in this article or tags in general, feel free to just reach out!

Want to find more of the things i'm doing? SatriumHub
Nov 20, 2023 14:31 by Joella Kay

This is marvelous! Thanks so much.

Nov 20, 2023 20:18

You're welcome! Glad it was helpful :)

Want to find more of the things i'm doing? SatriumHub
Mar 8, 2024 11:47 by Nicholas Kroll

This has helped so much in sorting through my articles, especially since I have a lot of lists that change semi-frequently and would otherwise need to be edited in numerous places, and I was wondering how you got your Cities & Settlements glossary linked at the top to look like that. It looks much nicer than those that I made with the mouseover boxes showing the entirety of the article. Mine so far following this guide just do text lists which work, but aren't particularly nice to look at. I was wondering if that is CSS work or something else?

Mar 8, 2024 13:04

I'm glad this was helpful for you!   I'm using a lot of custom CSS in my world, to style article blocks. You can switch the tagged-lists between link mode and block mode, but other than that it's all custom CSS. The main issue with block mode is that they can become very big, as it embeds a full article block instead of just the text link. So I used a lot of css to restyle my block links to be more condensed.   Try if the block mode of tagged lists (

) works for you, otherwise feel free to jump onto the WA discord and tag me in the #css-help channel and I'll see if I can help you make these condensed blocks I'm using.

Want to find more of the things i'm doing? SatriumHub
Mar 8, 2024 13:05

ok so apparently tagged lists kinda work in comments, so it messed up the formatting of my previous one :D   to switch between link mode and block mode just change tagged:idx-x-char|list|none to tagged:idx-x-char|block|none

Want to find more of the things i'm doing? SatriumHub
Mar 9, 2024 02:48 by Nicholas Kroll

Ah, that did it. Thank you so much!

Powered by World Anvil