FANDOM


Forums: Index Help desk Category Inheritance


I created a template for an infobox on a fairly new wiki. I've made templates before and never had this much trouble. For some reason or other, the pages using the template are inheriting the category "templates" from the original template. I started by cutting and pasting the coding from other templates from another wiki where I'm an admin. I've read through most of the wikipedia help pages on templates, categories and transclusion but I still can't seem to get it to work. The template is: here. If someone could figure this out for me I'd really appreciate it as my head is starting to ache from banging it on my desk so many times in the last few days.

StudyingDragon (talk) 17:32, September 2, 2012 (UTC)

Ooh, this one was a bit tricky. To figure this out, let's start with what we know: the infobox, {{Primary Ingredient}}, doesn't have any category tags directly in its code (you can confirm this by hitting ^ Ctrl+F and searching for "Category"). Instead, the "Templates" category is added by the infobox's /doc subpage, which is transcluded in <noinclude/> tags. Since it's impossible for these to "leak" when the infobox is transcluded on articles, we know the problem isn't the infobox itself or its /doc subpage. So, let's look at one of the articles it's transcluded onto: w:c:chefville:Tomato. The category definitely appears there, so let's click "Edit". Again, the category isn't anywhere directly in the page's code, so we have to look elsewhere. Click the "Show list of used templates" link in the right-hand pane, and we get {{Primary Ingredient}}... and {{-C}}. Aha, now we're getting somewhere! Open {{-C}}, click "Edit", and we see, on a separate line, [[Category:Templates]]! ディノ千?!? · ☎ Dinoguy1000 01:15, September 3, 2012 (UTC)
Smacks face really hard. I knew it would be something really stupid. Thank you for pointing it out, I wasn't even thinking about that little copyright template I made. StudyingDragon (talk) 03:47, September 3, 2012 (UTC)
No problem, and don't beat yourself up too hard; these little, obvious things can often cause the most trouble when debugging stuff. ;) ディノ千?!? · ☎ Dinoguy1000 05:46, September 3, 2012 (UTC)

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.