• 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.

Proposed Quality of Life Change to the Discussions Template

Status
Not open for further replies.

Just a Random Butler

Profile Enthusiast
VS Battles
Super Moderator
Administrator
Messages
2,601
Reaction score
5,149
Hello, Butler is here to propose something simple and hopefully makes things easier for staff and editors included.

In our wiki, the {{Discussions}} template play an important role in connecting relevant forum threads to their corresponding wiki pages. Currently, the process of generating these links requires editors to manually copy and adjust page names to match the format used in XenForo/Forum tags (Usually the case for new pages). Due to XenForo's handling of spaces, punctuation, and special characters, this often results in tedious manual adjustments, and mistakes are frequent even among regular editors. To make this easier for the majority of users and reduce errors, I am proposing an enhancement to the template.

The Old Template (What we have)
At present, this is how the {{Discussions}} template work:

Wiki page name: Example/Name (Series 2)

Required forum tag: ExampleName Series 2

How it can be written:

  • {{Discussions|ExampleName Series 2|Example/Name (Series 2)}}
  • {{Discussions|Custom Tag 2|Example/Name (Series 2)}}
    • Only do this if it already has a tag and if the page's forum tag differs from its page name.

While instructions exist for manually formatting these links, this is still error-prone and not immediately intuitive for all editors.

The Modified Template (What it will be)
Now, the template will be modified to use the new module. With this change:

  • If a user simply uses {{Discussions}} without providing a custom link, the template will automatically generate a XenForo-compatible forum tag based on the page name, handling spaces and special characters automatically.

  • If a user provides a custom forum tag link, the template will use it and automatically sanitize it to ensure it is compatible with XenForo. The display text, however, will remain exactly as entered.
This is how the modified template can be used:
Wiki page name: Example/Name (Series 2)

Required forum tag: ExampleName Series 2

How it can be written:
  • {{Discussions}}
  • {{Discussions|ExampleName Series 2|Example/Name (Series 2)}}
  • {{Discussions|Example/Name Series 2|Example/Name (Series 2)}}
    • Normally, you aren't supposed to do this, but the modification makes it so that this won't lead to a dead end.
  • {{Discussions|Custom Tag 2|Example/Name (Series 2)}}
    • Only do this if it already has a tag and if the page's forum tag differs from its page name
Users can now leave it as just {{Discussions}} without manually sanitizing the tag. However, they will still need to manually create the tag in the forum based on the page name, as we've usually done.

If users add illegal characters by accident, the template will automatically handle it and make it so that only characters accepted by XenForo are there.

This will:
  • Eliminate the need for manual sanitization of page names when generating forum links.

  • Reduce errors caused by illegal characters. (Such as the characters listed here)

  • Still maintain full flexibility as custom links and custom text displays are still supported if provided.

  • If XenForo's handling of tags changes in the future, the module can easily be updated to adjust how illegal characters are cleaned, ensuring that the template is future-proof.

This will NOT:
  • Change or override any custom text already provided by the user.

  • Change the way how the template is formatted. You can still continue using the template the way you've been using it if you want.

  • Automatically create new tags in the forum. Users must still ensure the tag exists in XenForo first and make a tag using the page's name.

  • Stop users from making a completely custom forum tag if they wish.

  • Affect any other templates outside of {{Discussions}}.

  • Change any rules.

Specific change in the code:
<h2>Discussions</h2><includeonly>
{| style = "border: 2px solid #006CB0; border-radius: 5px" width=100%
| style = "text-align: center; border-radius: 5px; color: #E5F6FF; background: #006CB0" | [[vsforum:tags/{{#replace:{{{1|{{PAGENAME}}}}}|<nowiki> </nowiki>|-}}/|<font color ="#E5F6FF">'''Discussion threads involving {{{2|{{PAGENAME}}}}}'''</font>]]
|}</includeonly><noinclude>A template that adds links to the forums. Auto-generates links without user intervention.</noinclude>
<h2>Discussions</h2><includeonly>
{| style="border: 2px solid #006CB0; border-radius: 5px" width=100%
| style="text-align: center; border-radius: 5px; color: #E5F6FF; background: #006CB0" | [[vsforum:tags/{{#invoke:MDTCU|sanitize|{{{1|{{PAGENAME}}}}}}}|<font color="#E5F6FF">'''Discussion threads involving {{{2|{{PAGENAME}}}}}'''</font>]]
|}</includeonly><noinclude>A template that adds links to the forums. Auto-generates links without user intervention.</noinclude>

For more info:
(The code here will just be transferred to the current Discussions template)
(The module that will be used by the template)
 
Thank you for helping out. It seems like a good initiative, although ideally our members should use the same tag titles as for the corresponding pages in our wiki, and there is a page in our forum available for our bureaucrats and super moderators that can, for example, change an entire tag called "#dccomic" to "DC Comics" instead. Would it be better if I teach you how to properly use that program instead, as long as you use it extremely carefully? 🙏
 
Thank you for helping out. It seems like a good initiative, although ideally our members should use the same tag titles as for the corresponding pages in our wiki, and there is a page in our forum available for our bureaucrats and super moderators that can, for example, change an entire tag called "#dccomic" to "DC Comics" instead. Would it be better if I teach you how to properly use that program instead, as long as you use it extremely carefully? 🙏
I just want to make it clear that the modification isn't meant to override or change any existing forum tags used by pages, nor is it supposed to change how members are expected to create tags in the forums. I will also make it clear that the template will not change currently existing pages that are using the templates with their own existing tags.

Users can simply leave it as {{Discussions}} (in the page), and the template will work even if the page name contains parentheses or other special characters. They would still need to manually create the tag in the forum, and ideally the tag name should still be based on the page name, as I mentioned earlier here:
Users must still ensure the tag exists in XenForo first and make a tag using the page's name.

My focus is on preventing formatting issues at the template level for newly created pages. The core problem is that many users create forum tags by copying the page name directly, which is good, but they do not adjust how the template generates or formats the link on the wiki side to properly match it (especially when it contains special characters). With what I am suggesting, it will work even if they forget to do that. There is also the added benefit that whatever tag is entered into the template, it will automatically sanitize any special characters to ensure the link still works, reducing the likelihood of errors.

What you suggested is definitely helpful, but from what I understand, it addresses a different issue, specifically the mass renaming or adjustment of existing tags. It does not fully resolve the broader problem this proposal aims to address. Your suggested approach is still quite manual, and there are not enough of us to consistently handle it at scale. It seems more suited for situations where pages are being renamed rather than preventing linking issues from the start. That said, I would genuinely be interested in learning how to use that tool as well.

This was meant to be the template's original purpose, which was to use the page name as the forum link. Since XenForo does not handle certain special characters properly, the modification simply ensures that the tag is automatically cleaned up so the default link function works correctly.
 
Last edited:
Have you properly thoroughly tested that your code functions properly and does not have any bugs? 🙏
 
If you have verified that your revision works as intended, I suppose that we are almost finished here, but I think that we need to update the following page with new information first. 🙏

 
If you have verified that your revision works as intended, I suppose that we are almost finished here, but I think that we need to update the following page with new information first. 🙏

Sorry for the late update, I was busy with work.

The standard format pages that currently include Discussions template instructions will mostly have those instructions replaced by the section I rewrote here:

I will explain the changes and why:

The instructions for converting old tags (for example, where % used to be converted to 25) have been removed. There are now almost no pages using those old tags, and if any remain, they should ideally be reported to your local Administrator, so they can update them to match the exact page title.

The instructions for converting tags after the forum migration have also been removed. The template now automatically handles special characters, so users only need to create a tag in the forums that exactly matches the page title. That's why the instructions are obsolete.

Pages that already have their tags defined within the template do not need to be modified. Updating them is not much of a priority, and doing so carries the risk of users accidentally changing tags that may correspond to existing custom forum tags. So, leave them to Administrators...

Also, pages with custom tags should ideally be handled by Administrators.
 
So, is it alright for me to proceed with making the changes to the standard format pages now?
 
Status
Not open for further replies.
Back
Top