コンテンツにスキップ

「テンプレート:折り畳みボックス」の版間の差分

提供:信号機Wiki
WikiPediaで使用されている折り畳み式ボックスのテンプレートを自前で作成(テスト)
 
ベースフォーマットをインラインCSSで記載
1行目: 1行目:
<!-- 折り畳み式テンプレート -->
<!-- 折り畳み式テンプレート -->
<div class="custom-template-expandable-box">
<div class="custom-template-expandable-box" style="border: 1px solid gray; margin: 0.2rem;">
     <div class="custom-template-expandable-box-header">
     <div class="custom-template-expandable-box-header" style="background-color: {{{header_color}}}; display: flex; justify-content: space-between;">
         <p>{{{title}}}</p>
         <p style="text-align: center; width: 100%; font-size: 120%; font-weight: bold; margin: 0;">{{{title}}}</p>
         <p class="custom-template-expandable-box-toggle-label"></p>
         <p class="custom-template-expandable-box-toggle-label" style="flex-shrink: 0; padding: 0 0.5rem; margin: 0; color: blue; text-decoration: underline; cursor: pointer;">[表示]</p>
     </div>
     </div>
     <div class="custom-template-expandable-box-contents">
     <div class="custom-template-expandable-box-contents" style="padding: 0.5rem; background-color: #fcfcfc; ">
         {{{contents}}}
         {{{contents}}}
     </div>
     </div>
45行目: 45行目:
"type": "boolean",
"type": "boolean",
"default": "False"
"default": "False"
},
"header_color": {
"aliases": [
"ヘッダーカラー"
],
"label": "ヘッダーの色",
"description": "ヘッダーの色を16進数カラーコードで記載します。CSSに埋め込まれるので認識できればカラーコードじゃなくても構いません。",
"example": "#000000 / gray / rgb(255, 128, 0) など",
"default": "silver"
}
}
},
},
"description": "WikiPediaで使用されているガジェットの表示・非表示を切り替えられるテンプレートを再現しました。100%ではないですがテンプレートとして配置することができます。",
"description": "WikiPediaで使用されているガジェットの表示・非表示を切り替えられるテンプレートを再現しました。100%ではないですがテンプレートとして配置することができます。(現時点作成中)",
"format": "block"
"format": "block"
}
}
</templatedata>
</templatedata>
</noinclude>
</noinclude>

2025年12月11日 (木) 11:58時点における版

{{{title}}}

[表示]

       {{{contents}}}


WikiPediaで使用されているガジェットの表示・非表示を切り替えられるテンプレートを再現しました。100%ではないですがテンプレートとして配置することができます。(現時点作成中)

テンプレートパラメーター[テンプレートデータを編集]

このテンプレートは、パラメーターを複数行に分けて記述することが推奨されています。

パラメーター説明状態
タイトルtitle タイトル

折り畳みボックスのタイトルを指定します。常時表示されます。

項目名
文字列必須
内容contents 内容 コンテンツ

折り畳みボックスに格納するコンテンツを入力します。技術的な制約から、ビジュアルエディターで挿入する場合でもソースコードからコピーして入力してください。中身がなくても作れますが意味がないので入れてください。

文字列推奨
デフォルトの開閉opened フラグ 開く

Trueに設定すると、デフォルトでこの折り畳みBOXは開いた状態になります。既定値はFalseです。

既定
False
True
ブール値省略可能
ヘッダーの色header_color ヘッダーカラー

ヘッダーの色を16進数カラーコードで記載します。CSSに埋め込まれるので認識できればカラーコードじゃなくても構いません。

既定
silver
#000000 / gray / rgb(255, 128, 0) など
不明省略可能