Template:ItemX

Usage
ItemX is an extension of Template:Item for consolidating the display recipes of crafted items and their parts on one page. It and its helper templates are built to make converting Item templates as easy as possible given limitations in the MediaWiki language.

Most of the time you should not need to interact with this template directly, so before reading further, you should be sure to read the Quick Start Guide located at Template:ItemX/init.

For best results, all ItemX data templates should be generated using the "[Add]" link automatically generated by ItemX/init. Nonetheless, this documentation is provided just in case there is a mis-entered or otherwise misbehaving data template that needs repairing (though most misbehaving tags can be repaired by simply replacing  with   tags).

This template takes 4 inputs:

Expansion Depth
If ItemX looks off (i.e. an item loses color or if table looks completely broken), it is possible that the item's complexity exceeds the template expansion depth limits set on this server.

To verify if an item has exceeded its expansion depth, look at the item page in edit mode and check if you see the line "Page has exceeded the expansion depth" near the top of the page as shown below:

The following are workarounds for this issue (try from top to bottom):
 * 1) Find the most expanded craftable components of the item (e.g. for, the two most expanded craftables are and ) and go to their respective ItemX data templates. For each of the   tags, remove the 4th parameter (which should be a template tag for an uncraftable item; uncraftables have empty pages, so there is no need to expand nothing). Obviously only do this for items which is crafted only from uncraftable components.
 * 2) If the previous step was not enough to dismiss the warning, on the most expanded craftable items, insert  in front of each  . This imports code from ItemX directly into the data template itself, bypassing ItemX. One drawback to this approach is that future updates to ItemX will not automatically carry over to this item; please post a note on this template talk page if you do this so that we know which data templates will need to be manually updated.
 * 3) If modifying the most expanded craftables is not enough to dismiss the warning, you can reduce the expansion from the opposite end by using  on the item page instead of the usual subst-less version. This will reduce expansion depth slightly as well.
 * 4) If still having expansion depth problem, please forward the issue to the talk page.

Wrong Recipe
Working on one item but seeing the recipe for something else entirely? You are probably just passing the wrong template as the 4th parameter (which may happen if you attempt to modify a recipe after saving).

To ensure proper formatting, just replace all  with   and save. The subst:ItemX/add template should fix it automatically.

Mobile view
The expansions and edit links are disabled in mobile view. This behavior is intentional due to lack of support for the  class in mobile view. If you need to see the recipe, you can [ switch to desktop mode by clicking here].

Recipe not updating
Is a change you made in a recipe not showing up on the item page? Just add  to the end of the item page's url like so:

Tools
Here are some javascript-based tools.

Note that some browsers will remove the  prefix when you paste the code (a safety feature to protect you against accidentally loading malicious scripts but also blocks good scripts). You may have to manually type in the javascript prefix for it to work. (A trick would be top copy everything but the first jthat is . Then type a j in the address bar and then paste the rest. Or just make a bookmarklet and you can run the script on click). Both of the above methods work on most major browsers except Firefox, which users will have to open the Console by pressing CTRL+SHIFT+K and pasting the script into the input at the bottom of the console.

expandAll.js
Want to see a full recipe without clicking? Just copy the the following script into the address bar of your browser: javascript:importScript('User:CodeHydro/expandAll.js');

enhancedItemX.js
Recipe contains the same item over and over again in many spots? Here's a script that will add everything up for you:

javascript:importScript('User:CodeHydro/enhancedItemX.js');

After you execute that script, the total amount needed for the recipe will appear next to the item. For example, with a you may see:

Meaning 2 are needed to craft one of the item directly above and a total of 45 are needed for the entire recipe. If you hover your mouse over the item (anywhere but over the link), you will also see a tooltip which shows the subtotal for that branch only (may not work on mobile screens even in desktop view).

Of course totals may be off if there are any ingredients say "Missing recipe data template".