v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Editing Create new FAQ category

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.

If you are creating a redirect to the current version's page, do not use any namespace. For example: use #REDIRECT [[Cat]], not #REDIRECT [[Main:Cat]] or #REDIRECT [[cv:Cat]]. See DF:Versions for more information.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 +
I used a fairly complex system to set up the FAQ page; involving templates, tables, and invisible headers. So this page is me providing an explanation of how it all works together, and the basic code which you can copy-paste to create your own FAQ category.
 +
 +
[[User:Juckto|Juckto]] 20:56, 26 November 2007 (EST)
 +
 +
 +
__TOC__
 +
 +
 
=Template=
 
=Template=
 
A template is a wiki tool that acts kinda like a global "copy-paste" function. If you create a template page you can use it anywhere else on the wiki by simply using the <nowiki>{{ }}</nowiki> code.  
 
A template is a wiki tool that acts kinda like a global "copy-paste" function. If you create a template page you can use it anywhere else on the wiki by simply using the <nowiki>{{ }}</nowiki> code.  
Line 24: Line 32:
 
This is the table I used in the templates, and the invisible comments I included to help anyone who wanted to add new questions to the template at a later date. Copy this entire section into your template page, and replace <u>everything</u> that is shown here in bold (note, some is off to the right).
 
This is the table I used in the templates, and the invisible comments I included to help anyone who wanted to add new questions to the template at a later date. Copy this entire section into your template page, and replace <u>everything</u> that is shown here in bold (note, some is off to the right).
  
On that note, I'm sorry about breaking the width on this page, but it has to be done otherwise this code breaks (badly) when you copy-paste it. This code is for the Wood FAQ, but you can easily change the names to reflect your new category.
+
On that note, I'm sorry about breaking the width on this page, but it has to be done otherwise this code breaks (badly) when you copy-paste it.
  <nowiki> <!---To add a new question, COPY the following two lines. ALL OF THEM. Yes I *DO* mean the |- stuff TOO. And PASTE them BETWEEN the ###### comments lower on this page.
+
  <nowiki> <!---To add a new question you need to scroll down to the bottom of this page and edit in TWO lines of code in the indicated spot.
 +
The 2 lines should be:
  
|-
+
|-
| [[Your question exactly as you want it to be read by others]]
+
| [[Your question exactly as you want it to be read by others]]?
  
LEAVE THE QUESTION MARK OUT, as this wiki engine doesn't cope well with creating %3F pages.
+
Leave the question mark out of the link, as this wiki engine doesn't seem to cope well with creating %3F pages.
--->
 
  
<center>
+
The first line of code starts a new line of writing within the table, the second puts your question in and the [[ ]] make the question have it's own page for answering. Go ahead and scroll down now.--->
{| class="collapsible collapsed infobox" style="background-color: #f9f9f9; border: 1px solid #aaa; font-size: 90%; margin: 1em 0em 0em; padding: 2px; text-align: center; width: 60%;"
 
! colspan="2" style="border: 1px solid #aaa; font-weight:bold; background-color: #ccf; padding-left: 1em; padding-right: 1em;" | '''Wood FAQ'''
 
|-
 
| [[Do I really need wood|Do I really need wood?]]
 
|-
 
| [[Wood|Where can I get wood?]]
 
|-
 
| [[Tower-cap|How do I build an underground tree farm?]]
 
<!--- ########### Insert new questions below this line ########### --->
 
  
<!--- ########### Insert any new questions above this line ########### --->
+
{| align=center style="width: 80%; background: #DEDEDE; border: 1px solid #999; border-left-color:#CDCDCD; border-top-color:#CDCDCD; text-align: center"
|-
+
|+ style="color: #fff; background: #bbb; border: 1px solid #999; border-left-color:#CDCDCD; border-top-color:#CDCDCD; padding: 0.2em 0.5em;  text-align: center" | '''</nowiki> <b>(Insert your category title here)</b> <nowiki> FAQ'''
|height="10"|  
+
|-
|-
+
| [[</nowiki><b> (Your first question) </b><nowiki>]]
| {{Edit|Template:Wood_FAQ|Add a question to the Wood FAQ}}
+
|-
 +
| [[</nowiki><b> (Your second question) </b><nowiki>]]
 +
|-
 +
| [[</nowiki><b> (Etcetera) </b><nowiki>]]
 +
<!--- ########### Insert any new questions above this line ########### --->
 +
|-
 +
|height="10"|  
 +
|-
 +
| {{Edit|Template:</nowiki><b> (Insert the category's name here - eg Magma_FAQ) </b><nowiki>}} Add a question to the </nowiki><b>(Insert your category title here) </b><nowiki> FAQ]
 
|-
 
|-
 
| [[Frequently Asked Questions|Back to the Main FAQ]]
 
| [[Frequently Asked Questions|Back to the Main FAQ]]
 +
|}
 +
{| align=center
 +
|<small>This template has yet to be coloured in with pretty colours</small>
 
|}
 
|}
 
<includeonly>[[Category:FAQ - Wood]]]</includeonly>
 
<noinclude>[[Category:Templates]]</noinclude>
 
 
 
</nowiki>
 
</nowiki>
  
Line 61: Line 67:
  
 
[http://dwarf.lendemaindeveille.com/index.php?title=Template:Magma_FAQ&action=edit An example of what the finished template code should look like]
 
[http://dwarf.lendemaindeveille.com/index.php?title=Template:Magma_FAQ&action=edit An example of what the finished template code should look like]
 +
 +
=Invisible Headers=
 +
Now for the final bit, adding your new category into the FAQ page. Just add the following code into the FAQ page.
 +
When it came time to insert the templates into the overall FAQ page, I struck a problem. I wanted the page to have a Table of Contents (TOC), but there didn't seem much point in having them displayed throughout the page since every template was self-titled. Was there anyway I could supress them?
 +
 +
 +
==Invisible Headers Code==
 +
After a little fiddling around in a sandbox I came up the following solution:
 +
 +
<nowiki><h5><font color=”white”></nowiki><b>(Title as you want it to appear in the TOC)</b><nowiki></font></h5>
 +
{{</nowiki><b>(Name of your template)</b><nowiki>}}</nowiki>
 +
 +
It's not true invisibility, but makes the headers white, meaning they can't be seen on the white background. If you try highlighting the text on the FAQ, you will see them ;).
 +
 +
 +
=Sub-categories=
 +
To make your new category a sub-group of the overall FAQ category, simply click on the link at the bottom (it should be red), and copy the following code. Now your category is a sub-category of the FAQ category, and any new question added should be added to your category’s … category (doh).
 +
 +
 +
==Sub-category code==
 +
If you want to write an answer to somebody else’s posted question please try to keep the answer short and simple, and link to the in-depth explanations elsewhere in the wiki. Don't forget to include the template into your answer (copy the following code into your answer):
 +
 +
  <nowiki>{{</nowiki><b>(Name of your template)</b><nowiki>}}</nowiki>
 +
 +
<nowiki>[[Category:FAQ]]</nowiki>
 +
  
 
=Answers=
 
=Answers=

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

Template used on this page:

This page is a member of 1 hidden category: