# Move default XWikiPreference UI elements to templates

**URL:** <https://forum.xwiki.org/t/move-default-xwikipreference-ui-elements-to-templates/15911>\
**Category:** Development\
**Tags:** proposal\
**Created:** [November 13, 2024, 3:31pm UTC](https://forum.xwiki.org/t/move-default-xwikipreference-ui-elements-to-templates/15911 "2024-11-13T15:31:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [November 13, 2024, 3:31pm UTC](https://forum.xwiki.org/t/move-default-xwikipreference-ui-elements-to-templates/15911/1 "2024-11-13T15:31:08Z")

</div>

Hi devs,

As you probably know already, the XWikiPreference document is a huge mess and is pretty much the worst possible example of extension page, containing a mix of everything that should never be mixed in the same document: xclass, custom rights, default configuration, custom configuration, etc. It even contains things which are actually more UI elements that we would usually put in templates, UI extensions, or even email templates if they were introduced today:

- `meta`: part of the HTML tag
- `confirmation_email_content` and `validation_email_content`: I assume, according to their content, mail templates used in the validation process.

Since XWikiPreferences is such a mess and would be way too dangerous to merge, it’s not merged. This means that the UI elements indicated above are never updated during an XWiki upgrade.

For now, I would like to propose a very simple change to improve the situation for future new installations for those 3 UI elements: move their content to their own location, and in the code where we currently evaluate the content of those 3 fields have a fallback on those new locations when the content is empty.

That way, when an instance which started with this logic is upgraded, it will benefit from update/fix of those default content. It also means that it’s easy to include the content of the template when you just want to add stuff before/after the standard content without modifying it.

For the locations I propose templates in xwiki-platform-web-templates since those templates are easy to include, and their content seems generic enough for any skin (but it would still allow a skin to customize them).

WDYT ?

Here is my +1 for moving those scripts to upgradable locations and +1 for these locations to be xwiki-platform-web-templates templates.

---

<div class="post-metadata">

**Author:** ![MichaelHamann](https://forum.xwiki.org/user_avatar/forum.xwiki.org/michaelhamann/32/3813_2.png) [@MichaelHamann](https://forum.xwiki.org/u/MichaelHamann)\
**Post date:** [November 28, 2024, 9:13am UTC](https://forum.xwiki.org/t/move-default-xwikipreference-ui-elements-to-templates/15911/2 "2024-11-28T09:13:08Z")

</div>

What do you plan to do with the administration sections that currently allow customizing them? Afaik, at least the `meta` part is currently customizable in the administration.

The problem with what you propose is that if somebody customizes these fields, there won’t be any notice on upgrades, again. So unless we think that these fields should only be rarely customized, I’m not sure if this improves the situation a lot. For the `meta` part, I’m wondering if a UIXP could be an interesting solution, at least if we also implement [proposal 2 of this thread](https://forum.xwiki.org/t/ability-to-configure-export-ui-buttons-more/10070) to allow disabling UIX.

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [November 28, 2024, 9:57am UTC](https://forum.xwiki.org/t/move-default-xwikipreference-ui-elements-to-templates/15911/3 "2024-11-28T09:57:28Z")

</div>

> [@MichaelHamann](#):
>
> What do you plan to do with the administration sections that currently allow customizing them?

As I said, I don’t plan to remove them, they will still work as before (but by default they will be empty). The difference will be that it will be easy to include the standard version if you just want to add something before or after.

If you really want to modify them then it will be the same limitation as any template customization and yes you won’t have upgrades. We can’t remove those fields for obvious retro compatibility reason and IMO what I propose is already a much better situation since most people don’t customize those.

> [@MichaelHamann](#):
>
> For the `meta` part, I’m wondering if a UIXP could be an interesting solution, at least if we also implement [proposal 2 of this thread](https://forum.xwiki.org/t/ability-to-configure-export-ui-buttons-more/10070) to allow disabling UIX.

Once we moved it to a template, yes, we can more easily add all sort of extension points. What I propose here is not an end goal, it’s just the first step to move this content out of the XWikiPreferences area by default.

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [May 2, 2025, 8:34am UTC](https://forum.xwiki.org/t/move-default-xwikipreference-ui-elements-to-templates/15911/4 "2025-05-02T08:34:12Z")

</div>

> [@tmortagne](#):
>
> Here is my +1 for moving those scripts to upgradable locations and +1 for these locations to be xwiki-platform-web-templates templates.

+1 as well, thanks

---

<div class="post-metadata">

**Author:** ![mflorea](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mflorea/32/49_2.png) [@mflorea](https://forum.xwiki.org/u/mflorea)\
**Post date:** [May 2, 2025, 8:41am UTC](https://forum.xwiki.org/t/move-default-xwikipreference-ui-elements-to-templates/15911/5 "2025-05-02T08:41:53Z")

</div>

+1

Thanks,  
Marius

---

<div class="post-metadata">

**Author:** ![acotiuga](https://forum.xwiki.org/user_avatar/forum.xwiki.org/acotiuga/32/3815_2.png) [@acotiuga](https://forum.xwiki.org/u/acotiuga)\
**Post date:** [May 2, 2025, 9:22am UTC](https://forum.xwiki.org/t/move-default-xwikipreference-ui-elements-to-templates/15911/6 "2025-05-02T09:22:01Z")

</div>

+1

Thanks,  
Alex

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [August 14, 2025, 12:24pm UTC](https://forum.xwiki.org/t/move-default-xwikipreference-ui-elements-to-templates/15911/7 "2025-08-14T12:24:20Z")

</div>

I missed this proposal but IMO it’d not a good choice on 2 basis:

1. the content of the HTTP META field is supposed to contain content that is not important and that the admin user can want to change. Moving it to a meta.vm file hides what’s in there and makes it hard for the user to change or even know what it contains.
2. since it’s now not visible it’s making problems like [Attachments live data - Attachemnts list loading / vue 3 upgrade issue? - #7 by mflorea](https://forum.xwiki.org/t/attachments-live-data-attachemnts-list-loading-vue-3-upgrade-issue/17236/7) even more prone to happen

I’ve now created:

- [Loading...](https://jira.xwiki.org/browse/XWIKI-23456) (urgent issue)
- [Loading...](https://jira.xwiki.org/browse/XWIKI-23457)

Thanks

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [August 14, 2025, 12:25pm UTC](https://forum.xwiki.org/t/move-default-xwikipreference-ui-elements-to-templates/15911/8 "2025-08-14T12:25:29Z")

</div>

PS: Marking this thread as solved since it was implemented in [Loading...](https://jira.xwiki.org/browse/XWIKI-23160) (see [XWIKI-23160: Move XWikiPreferences meta field to a templates (#4124) · xwiki/xwiki-platform@a7cd55b · GitHub](https://github.com/xwiki/xwiki-platform/commit/a7cd55b06a536298e40af6b0b019ffe11517d3b7) )

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [August 14, 2025, 12:27pm UTC](https://forum.xwiki.org/t/move-default-xwikipreference-ui-elements-to-templates/15911/9 "2025-08-14T12:27:50Z")

</div>

> [@vmassol](#):
>
> the content of the HTTP META field is supposed to contain content that is not important

Problem is that it’s not true since a very long time. As explained, we had a lot of problems with this field being stored in XWikiPreferences and never upgraded (so not getting bugfixes, since it’s more code that actual values in there).

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [August 14, 2025, 12:41pm UTC](https://forum.xwiki.org/t/move-default-xwikipreference-ui-elements-to-templates/15911/10 "2025-08-14T12:41:14Z")

</div>

Removing the “solved” as the email part wasn’t done by Manuel and is outstanding. Note that the proposal has been accepted.

EDIT: the jira is at [Loading...](https://jira.xwiki.org/browse/XWIKI-23164)
