- 2,601
- 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:
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:
Wiki page name: Example/Name (Series 2)
Required forum tag: ExampleName Series 2
How it can be written:
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:
This will NOT:
Specific change in the code:
For more info:
(The code here will just be transferred to the current Discussions template)
(The module that will be used by the template)
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.
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
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>
{| 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>
{| 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)