Template inheritance (Community Wishlist/W120)
Let's say, we have an infobox for musicians. Now, we create a page for a musician of a specific music genre and add our infobox. However, we would want to add a field to the infobox specific to our genre, which is currently missing in the infobox and would not be used for other genres. Of course, we can
- Copy the infobox source code and create a new infobox with this and the new field
- Add the field as optional to the existing infobox
While both solutions work, they are not ideal
- Creating a new template: When changing either the existing infobox or the new one, they get out of sync
- Adding optional fields to the existing template: The template can get cluttered pretty quick with every genre adding their genre-specific optional fields and make it easy to lose the plot
A solution would be to use inheritance like in programming. You create a new template and define which template it inherits/extends, so you only have to add the additional, genre-specific fields.
Of course, the infobox is only an example and this would work in other contexts as well.
Unassigned
Template creators/editors
- Created: 11:24, 29 July 2024
- Last updated: 16:32, 20 November 2025
- Author: Minilexikon (talk)
This wish currently has 0 supporters. Voting for this wish is open until it is completed.