Forum:Randomly generated Did you know? page

Hi, I was wondering if it is possible to make a Did You Know? page, and then add something to the frontpage that could choose 3 random points from that page to display each time? Or would I just have to do this manually and change it?

Spatulade (talk) 16:55, July 19, 2012 (UTC)


 * 3 random points on the page.. that's a little tricky. If you just use the   tags and copy/paste part of the page into the options, it'll display the options randomly. Here's an example of it's use:

Code: Did you know? that goldfish can breath underwater?! It's true, they have gills that allow them to do this. More about this topic can be found here... Did you know? that airplanes can be found in the air?! Yup, it's true, since air particles try to meet with each other on top of the wings and under the wings, it allows them to defy gravity. More about this topic can be found here... Did you know? that humans can sit. More than likely, you're doing it now! More about this topic can be found here...

Use:


 * Did you know? that goldfish can breath underwater?! It's true, they have gills that allow them to do this.  More about this topic can be found here...


 * Did you know? that airplanes can be found in the air?! Yup, it's true, since air particles try to meet with each other on top of the wings and under the wings, it allows them to defy gravity.  More about this topic can be found here...


 * Did you know? that humans can sit. More than likely, you're doing it now!  More about this topic can be found here...


 * To get it to refresh, just refresh the page. Hopefully this will be a substitute. 17:07, July 19, 2012 (UTC)


 * Oh my goodness, this is amazing! Thank you so much for your help! I really appreciate it. http://images.wikia.com/dungeonkeeper/images/8/8f/Tentacle-icon.gif Spatulade (talk) 18:07, July 19, 2012 (UTC)
 * Another quick question, can I make it more complicated and have it so it would automatically update with a Did You Know page containing all the information i.e. it would add each bullet point of trivia from the page to the template? http://images.wikia.com/dungeonkeeper/images/8/8f/Tentacle-icon.gif Spatulade (talk) 18:12, July 19, 2012 (UTC)
 * One way to achieve that would be to put the did you know lines in a template and wrap the "choose/option" code in includeonly tags - when the template is included on the front page, it will display a random option, but when the template is viewed directly, it will show all the options at once. If you need help doing this, I'd be happy to lend a hand. --452 05:04, July 23, 2012 (UTC)


 * That would be really useful, can you perhaps give an example of how I would write this? http://images.wikia.com/dungeonkeeper/images/8/8f/Tentacle-icon.gif Spatulade (talk) 23:47, July 23, 2012 (UTC)
 * I've tried it myself, simply wrapping the code in includeonly tags, visiting the temple looks fine, but on the frontpage, I get appearing for some reason. http://images.wikia.com/dungeonkeeper/images/8/8f/Tentacle-icon.gif Spatulade (talk) 23:53, July 23, 2012 (UTC)
 * Ah, I see the problem.
 * The Choose/Option code is being parsed before the includeonly, so the the is part of the Option.
 * I played around and found a way to get it working. It's a little messy, but it gets the job done.
 * :) --452 01:47, July 25, 2012 (UTC)
 * Awesome, I left a message on your talk page on there, just asking one more thing. http://images.wikia.com/dungeonkeeper/images/8/8f/Tentacle-icon.gif Spatulade (talk)
 * Never mind, I've fixed it (sort of :P). Thank you very much for your help :) http://images.wikia.com/dungeonkeeper/images/8/8f/Tentacle-icon.gif Spatulade (talk)  18:02, July 25, 2012 (UTC)