Jump to content

Community Wishlist/Wishes/Template inheritance/ja

From Meta, a Wikimedia project coordination wiki
This page is a translated version of the page Community Wishlist/Wishes/Template inheritance and the translation is 10% complete.
Template inheritance Open

要望を編集 この要望について話し合う

説明

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.

割り当てられ済の重点領域

未割り当て

「要望」の分類

Feature request

関連するプロジェクト

ウィキペディア

影響を受けている利用者

テンプレート作成者/編集者

その他

  • 作成済: 11:24, 29 July 2024 (UTC)
  • 最終更新: 21:54, 2 August 2024 (UTC)
  • 記入者: Minilexikon (talk)