Community Central
Register
Community Central
This Forum has been archived
Forums: Admin Central Index General Questions Is there some kind of data entry template available?
Central's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 4019 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.



Is there a way to make something akin to a template of a piece of data on a table so I don't have to keep manually entering it every time and be able to make changes to it that will affect all of its entries? Say for example I'm making a table where rows of data can have similar data such as "company name" or "year published". I'd like to be able to have a template that has a piece of data, "Microsoft" for example, to go under the company name column, where I can basically just copy and paste that template wherever I need to enter "Microsoft". This way I'd also be able to go back and only have to change the template to affect all of its entries. Is this sort of thing possible to do with my wiki or is there an another way to achieve the same effect? Eagle 1ink (talk) 03:09, October 20, 2012 (UTC)

I don't completely understand what you mean. But maybe Semantic MediaWiki is what you want. Ultimate Supreme talk · wiki I · wiki II  03:31, October 20, 2012 (UTC)
Yes, there's probably several different ways to do this. The one I'd probably recommend to use the {{#switch parser function inside your table template. Here's an example: Suppose you used the following code inside a template that had a parameter called "company":
{{#switch: {{{company}}}
| val1 = Microsoft
| val2 = Boeing
| No Company Specified
}}
If you pass company = val1 to the template, it will be automatically be replaced with "Microsoft". If you pass company = val2, it will be automatically replaced with Boeing. If you pass anything other than val1 or val2, it will default to "No Company Specified"
I created an example template at w:c:mathmagician:Template:SwitchTest that uses this, and a page where you can see how the template is used w:c:mathmagician:SwitchTest. You could edit the template and change "Microsoft" just once to affect all pages using the template. 20px_Rin_Tohsaka_Avatar.png Mathmagician ƒ(♫) 04:13 UTC, Saturday, 20 October 2012