• This forum is strictly intended to be used by members of the VS Battles wiki. Please only register if you have an autoconfirmed account there, as otherwise your registration will be rejected. If you have already registered once, do not do so again, and contact Antvasima if you encounter any problems.

    For instructions regarding the exact procedure to sign up to this forum, please click here.
  • We need Patreon donations for this forum to have all of its running costs financially secured.

    Community members who help us out will receive badges that give them several different benefits, including the removal of all advertisements in this forum, but donations from non-members are also extremely appreciated.

    Please click here for further information, or here to directly visit our Patreon donations page.
  • Please click here for information about a large petition to help children in need.

Making Tier Templates Usable on Sandboxes/Blogs/Profile Drafts

Status
Not open for further replies.

Just a Random Butler

Profile Enthusiast
VS Battles
Super Moderator
Administrator
Messages
2,603
Reaction score
5,160
Hi everyone. Butler here.

I'd like to propose a small but helpful change to the tier templates: specifically to prevent them from automatically adding category tags when used outside of the main namespace.

For those who aren't aware:
Currently, our tier templates automatically add tier categories to pages. This makes it convenient for users to update a character's tier without needing to manually add or remove the category.

The issue is that, this same template is still being used to this day by users on profile drafts, which also automatically add categories to pages.

Currently, the usual procedure is to leave a warning on the user's message wall and explain the issue. But honestly, this feels like a waste of time. I'm sure the staff members handling it are getting tired of repeating the same thing, and the users are probably just as tired of receiving these messages. It isn't enjoyable for anyone. With this change, users also won't need to constantly adjust the tier templates by replacing them with bold text as they can simply use the templates as intended without any extra hassle.

What I've done:
I've tested a fix on the {{0}} (Tier 0) template that conditionally includes the category only when the page it is used in is the main namespace. (I tested it on the Tier 0 template since it only affects a small number of pages)

It works.
I purged/refreshed five existing Tier 0 pages, their categories still appear as normal, so nothing broke. ✅
I copied a Tier 0 page to my sandbox (excluding the traditional categories), no tier category appeared. ✅
I tested it in a blog post, also no tier category. ✅

Proof that it doesn't apply categories to sandboxes and blogs:
https://vsbattles.fandom.com/wiki/User:Just_a_Random_Butler/TT
https://vsbattles.fandom.com/wiki/User_blog:Just_a_Random_Butler/Test

The implementation is simple. The same changes I applied to the Tier 0 template will be made to all tier templates. No bots, no semi-automation, no scripts, and no site-wide revisions are necessary.

What this means?
✅ People can now use tier templates on sandboxes and blog pages used as profile drafts. Staff won't have to warn people about the use of tier templates on sandboxes and the like.
❌ But categories still cannot be directly added to sandboxes and blogs (example: [[Category: Characters]], [[Category: Female Characters]], or even manually adding tier categories)

If no one has any objections, I can apply this change to all of our tier templates. That way, everyone will finally be able to use them on their sandboxes without staff having to step in.

If you do have concerns, please feel free to bring them up.
 
However, we need other knowledgeable members to check for any potential errors in your coding, in order to remain on the safe side.
Sure. I can explain how it works for content moderators.

Here's how it was before:
[[Category:Tier 0]]

This adds the Tier 0 category, regardless of where the page is.

Here's the new one:
{{#if:{{NAMESPACE}}||[[Category:Tier 0]]}}

This is an if parser function, and the one used in our Tier 0 template right now for testing.

This is how it works:
{{#if: STRING | then (if string: non-empty) | else (if string: empty)}}

The if function checks whether a given string is empty or non-empty. In this case, the string is {{NAMESPACE}}, which MediaWiki returns the namespace of the page it's used on.

Things to consider:
  • If the page is in the main namespace, {{NAMESPACE}} returns an empty string (""). This is considered empty.
  • If the page is in another namespace (like User, User_blog, etc.), it returns that namespace name (e.g., User), which is considered non-empty.
Let's say for the Tier 0 example. If {{NAMESPACE}} is empty (it's a mainspace page), it outputs [[Category:Tier 0]].
If it's not empty (It means the returned namespace is not main. It could be User or blog page), then it outputs nothing, resulting in no tier categories added.
 
Last edited:

Closing this.
 
Status
Not open for further replies.
Back
Top