Forum:Template Creation

How do I create a template easily? I don't want to make an infobox template-rather this one on the Sims Wiki. Can someone show me how? Any help would be appreciated.

GRKSpeed 20:15, December 4, 2011 (UTC)


 * Never thought of "wiki template" and "easy" as words that belong in the same sentence (but, I usually end-up coding ones with hundreds of lines). This is relatively straight-forward. Create a new page on your wiki "Template:NAME" where "NAME" is what you want your template to be called (what you will enter between these to call it: ). (It might be easier to do this by editing the URL up top and simply putting Template:NAME after /wiki/ . I don't actually know how Wikia's interface behaves when creating new pages.) Then you should be able to just copy and paste their code to yours. Presto. (Well, with a little tweaking, and any media resources, like the image, will have to be uploaded to your wiki as well.)


 * Note that that particular template you linked to is actually a call to another template, Parthenon. (This doesn't make much sense to me. What they're doing can be solved with a #switch: function in a single template, but I digress.) You should probably start with the code from their Parthenon template, look at that, and work backward.


 * Consult the template help pages while you're at this foray into template creation. >.> --Crimsonphoenixca 14:38, December 5, 2011 (UTC)


 * If you want a simple box...


 * If you put that in a template, then it would take one parameter, called "content" which fills it with content. ForestMonthZero 07:26, December 6, 2011 (UTC)
 * Since Wikia uses HTML5, it could be slightly better to conform to that standard:

13:54, December 6, 2011 (UTC)


 * Yeah. Just remember that a template is just a namespace with a few differences, and you transclude it onto another page. In fact, you can transclude any page onto another in the same manner that you do a template; just include the namespace.


 * Roads (So Ferb, how many licks does it take to get to the center of a Tootsie Pop?) 14:06, December 6, 2011 (UTC)