Template talk:5e Spell

From D&D Wiki
Jump to navigation Jump to search

Lowercase[edit]

The recent edit causes the school of cantrips to be capitalized when they should not be. E.g., fire bolt is an "Evocation cantrip" and not an "evocation cantrip." However, as you can see on razor tome, it should be "Transmutation cantrip" yet this template now forces it to be "transmutation cantrip."

I can't edit the page directly, but in theory the issue would be fixed by replacing this line:

| colspan="2" | ''{{#ifeq:{{{lvl}}}|cantrip| |{{{lvl}}}-level}} {{#ifeq:{{NAMESPACE}}|Main|5e {{{school}}} Spells|[[5e {{{school}}} Spells|<span style="text-transform:lowercase;">{{{school}}}</span>]]}} {{#if: {{{desc|}}}|[<nowiki/>{{{desc}}}<nowiki/>]|}}{{#if:{{{ritual|}}}|(ritual)[[Category:Ritual Tag]]}} {{#ifeq:{{{lvl}}}|cantrip|cantrip|}}''{{#if: {{{casttime|}}}|<nowiki/>

With this line:

| colspan="2" | ''{{#ifeq:{{{lvl}}}|cantrip| |{{{lvl}}}-level}} {{#ifeq:{{NAMESPACE}}|Main|5e {{{school}}} Spells|[[5e {{{school}}} Spells|{{#ifeq:{{{lvl}}}|cantrip| |<span style="text-transform:lowercase;">}}{{{school}}}{{#ifeq:{{{lvl}}}|cantrip| |</span>}}]]}} {{#if: {{{desc|}}}|[<nowiki/>{{{desc}}}<nowiki/>]|}}{{#if:{{{ritual|}}}|(ritual)[[Category:Ritual Tag]]}} {{#ifeq:{{{lvl}}}|cantrip|cantrip|}}''{{#if: {{{casttime|}}}|<nowiki/>

- Guy (talk) 18:59, 15 August 2017 (MDT)

Thanks for finding the right formatting, it seems to be working right now. --Green Dragon (talk) 00:08, 16 August 2017 (MDT)
Thanks, GD. I don't know why it didn't work last night for me, but I was tired anyways. Guy: Do you know of a way we could make the User category on by default, but let me pass through an off switch for it? I'd like to use this template for non-homebrew pages.--GamerAim Chatmod.png (talk) 05:56, 16 August 2017 (MDT)
That would require a parameter of some kind, but it would be pretty simple. For example, you could replace the current instance of [[Category:User]] with the following:
{{#if:{{{notuser|}}}||[[Category:User]]}}
If you slapped the above example somewhere into the template, it would include Category:User by default. Pages which already use this template would retain the User category. However, the User category would be excluded if there was any text entered for the "notuser" parameter, such as, "|notuser=gibberish" or "|notuser=example." You could of course change the parameter to something else instead of NotUser; whatever is most fitting. - Guy (talk) 06:14, 16 August 2017 (MDT)

Automated Categories[edit]

I was wondering if we can get this to add a category to spells, Spell 0 for cantrips and Spell (whatever number) for whatever level it is. Just to help make sure that spells actually show up where they need to since a lot of people are bad at category tags. I have manually done this to a large number of pages, but this would ensure it was changed automatically if the spell is edited. I would mockup a line, but I'm not very well versed at #ifeq to do it yet, I could probably muddle around and figure it out eventually haha --Meep (talk) 09:36, 25 February 2018 (MST)

I will temporarily change the protection on this page to allow you to try. I recall that the problem is that putting the word "cantrip" in this parameter makes it difficult to use the #ifeq function. There should be a way to make it work. --Green Dragon (talk) 12:17, 25 February 2018 (MST)
I do believe I figured it out --Meep (talk) 14:12, 25 February 2018 (MST)
You are right, #switch did the trick. Good work, impressive. --Green Dragon (talk) 11:16, 26 February 2018 (MST)

Can you undo the recent changes, There are quite a few pages set up specifically for the [[Category:Spell #]] --Meep (talk) 11:56, 28 March 2018 (MDT)