Template:Insert HGAPS User Box
User Boxes |
---|
ERROR: No User Box Name Entered |
Introduction
editThis is the home of our HGAPS User Boxes. A User Box is a tool that helps people viewing your page easily get a lot of information about your involvement. This template should only be used by HGAPS members, as by opting in for this template you are not easily able to add outside User Boxes to your User Box List. By using this small bit of code, you can easily create a user box collection that accurately describes your HGAPS narrative. This page is meant to serve as a menu that HGAPS members can pick and choose from.
To use this page, browse the available user boxes and see what applies to you. If you have an idea for a user box that is not currently added, post it in the discuss page of this template or tell your water carrier! (if you are the water carrier, speak with Eric or Cody) After finding relevant User Boxes, navigate to the Current User Boxes Supported section to copy their code. Add this code to the template call surrounded by the pipe "|" character. You can insert as many user boxes as you want! The template code (with your user box names inserted) should go at the very top of your user page, under "edit source", to guarantee proper formatting. Check out Cody Naccarato's user page to see what the implementation might look like.
Usage
editThis code has a few different parts. This code's length depends on how many user boxes you want to edit. The generic form of the code is below.
{{Insert HGAPS User Box| Country=YOURCOUNTRYorSTATE | BOXNAME1 | BOXNAME2 | BOXNAME3 | ... }}
The first part of this code is telling Wiki to insert an HGAPS user box. The COUNTRY part allows you to tell people what country/state you are from. This is optional, but the purpose of a User Box is to give info about yourself, so it is suggested. There is no limit to what you can place in the Country parameter, so you can add a state if you would like. The subsequent chunks of code between the pipes |...|
contain the name of the user boxes you would like to insert (BOXNAME = the name of the template you want to insert, replace BOXNAME in the actual implementation on your userpage). You can insert the user boxes in any order, and you can find a list of user box names in the table below. The total number of "chunks" you will have depends on how many user boxes you are inserting. Let's say you find 5 user boxes you like and accurately describe your HGAPS involvement, iff you wanted to add these 5 user boxes, you would keep adding the new chunks of code until you reached {{Insert HGAPS User Box| Country=US | Name1 | Name2 | Name3 | Name4 | Name 5 |}
, for which you would close the template with double curly brackets. The ellipses present is telling you that you can keep adding as many user box chunks as you want. However, when finished, do not add the ellipses in the final form of your code.
Note: we currently have the maximum insertable userboxes in this template set to 15, though that can be changed if necessary.
Example
editUser Box Call with 1 user box.
{{Insert HGAPS User Box| Country=US | Psychologist }}
User Box Call with 3 user boxes.
{{Insert HGAPS User Box| Country=US | Psychologist | Sociologist | Biologist }}
User Box Call with 5 user Boxes.
{{Insert HGAPS User Box| Country=US | Psychologist | Sociologist | Biologist | Programmer | Researcher }}
Current User Boxes Supported
editThis project contains a list of all currently supported User Boxes, along with the box names you need to use to replace "BOXNAME" in the template. If you have an idea for a user box you would like to see added to this list, please request it in the discussion page for this template!
NOTE: this is not the actual list of HGAPS user boxes, this is proof of concept
Name of Template (replace "BOXNAME" with this) | User Box Visualized | ||
---|---|---|---|
Psychologist |
| ||
Sociologist |
| ||
Biologist |
| ||
Programmer |
| ||
Medicine |
| ||
Researcher |
| ||
UNC |
| ||
Published Author |
| ||
Diversity |
| ||
Open Research |
| ||
Zotero |
| ||
Wiki Age |
| ||
Happy |
See also
editNo description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Country | Country country COUNTRY | your location of origin
| String | suggested |
Instructable: How to Edit this Template
editAdding Templates
editTo add templates, you must go to the source code, and under each "switch" function for each box name slot, you need to copy and paste your extra code. Adding a sixteenth user box requires updating the previous 15 switch functions, as well as adding an entirely new switch function (for a total of 16 switch functions). Your number of switch functions should equal the number of user boxes present.
The switch function works by taking in your parameter string (User Box X=), and comparing each character in the string you created with different options within each switch function. If the switch function finds an exact match, it returns the contents under that exact match (in this case, we are returning another template that redirects to our user box. so you actually need to create a separate page for each user box as they are transcluded THROUGH this template into your user page). For each extra user box you want to add, we run this search again. For this reason, it is important for you to update each and every switch function (as well as create a new switch function) as you add user boxes.