Community Wishlist/Wishes/Template inheritance/en
Template inheritance Open
Description
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.
Assigned focus area
Unassigned.
Type of wish
Feature request
Related projects
Wikipedia
Affected users
Template creators/editors
Other details
- Created: 11:24, 29 July 2024 (UTC)
- Last updated: 21:54, 2 August 2024 (UTC)
- Author: Minilexikon (talk)