Introduction
WikiText generators are simple, cache-based generators that are relatively user-friendly to create, but not to use. First, let's take a look at what exactly a WikiText generator even is.
Below, you will get an option, one through ten, at random. Click the generate another option button to get a new one.
You got option three!
Coding can also be put inside of the results in WikiText generators, although the example does not show this. You'll learn how later in this page! You'll also learn how to make the generate another option button!
Page Caches
Because WikiText Generators are page cache-based, meaning the page stores the data that you got a certain result, you won't get a new result from reloading the page. You MUST clear the page cache, which is where the data is stored. You can do this by clicking on the button in the example. We'll explore how to create a button to clear the page cache farther in this guide.
The Code
Generator Code
The code for a generator is quite simple. Type in the following:
<choose> <option>OPTION</option> <option>OPTION</option> <option>OPTION</option> </choose>
Replace the OPTION text with whatever you want inside the tags! You can have as many, or as few options as you like, but if you want a good and diverse generator, like a name generator, you'll definitely want a lot more than 3, 10, or even 20 options. To add another option, just put in an <option> tag, then your content, and then a </option> tag.
If you want to have code in some of the results, code as you usually would, but INSIDE of the <option> tags.
Button Code
Now that you've created the actual generator, you need to make it so that people can actually generate more options. To do this, type in the following, exactly:
<span class="plainlinks">[https://{{SERVERNAME}}.fandom.com/wiki/{{PAGENAME}}?action=purge Generate more options]</span>
You can replace Generate more options with what you want displayed.
Putting it all together
Add the link/button code to the Generator code. Then, run the generator! Make sure to test it, and to make sure you have enough options for whatever purpose your generator is to be used for. The end code should look something like this:
<choose> <option>OPTION</option> <option>OPTION</option> <option>OPTION</option> </choose> <span class="plainlinks">[https://WIKI ADDRESS/PAGENAME?action=purge TEXT HERE]</span>