Template:File Summary: Difference between revisions

From Bhikitia Pro, An open encyclopedia
Blossom (talk | contribs)
No edit summary
Tag: Reverted
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<html>
<div class="file-summary-box" style="width:100%;border:1px solid #aaa;background:#f9f9f9;margin:1em 0;"><table style="width:100%;border:none;"><tr><th colspan="2" style="background:#e6e6e6;text-align:left;padding:5px;">File Summary</th></tr><tr><td style="background:#eef;width:20%;padding:5px;">Description</td><td style="padding:5px;">{{#if: {{{description|}}} | {{{description}}} | <i>This file has no description. Please provide one.</i>}}</td></tr><tr><td style="background:#eef;width:20%;padding:5px;">Source</td><td style="padding:5px;">{{#if: {{{source|}}} | {{{source}}} | <i>This file is lacking source information. Please provide one.</i>}}</td></tr><tr><td style="background:#eef;width:20%;padding:5px;">Author</td><td style="padding:5px;">{{#if: {{{author|}}} | {{{author}}} | <i>This file is lacking author information. Please provide one.</i>}}</td></tr>{{#if: {{{license|}}} | <tr><td style="background:#eef;width:20%;padding:5px;">License</td><td style="padding:5px;">{{{license}}}</td></tr>}}{{#if: {{{date|}}} | <tr><td style="background:#eef;width:20%;padding:5px;">Date</td><td style="padding:5px;">{{{date}}}</td></tr>}}</table></div>
<head>
<noinclude>
  <style>
[[bn:Template:File Info]] </noinclude>
    .infobox {
      border: 1px solid #aaa;
      background-color: #f9f9f9;
      border-collapse: collapse;
      width: 300px; /* Adjust width for infobox */
      font-size: 90%;
      margin: 1em 0;
      float: right; /* Align to the right like a typical infobox */
    }
    .infobox th {
      background-color: #e6e6e6;
      border-bottom: 1px solid #aaa;
      text-align: left;
      padding: 5px 10px;
    }
    .infobox td {
      padding: 5px 10px;
      border-bottom: 1px solid #ddd;
    }
  </style>
</head>
<body>
  <!-- Infobox Container -->
  <table class="infobox" id="dynamicInfobox">
    <tr>
      <th colspan="2">Infobox Title</th> <!-- Replace with dynamic title if needed -->
    </tr>
  </table>
 
  <script>
    // Infobox data (Add only fields you want to display)
    const infoboxData = {
      Description: "Custom description for Bhikitia",
      Date: "16 September 2023",
      Source: "Own work",
      Author: "Chabe01",
      Location: "48° 53′ 25.22″ N, 2° 15′ 07.72″ E",
      "Custom Field 1": "Special Value",
      "Custom Field 2": "" // Empty fields will not appear
    };
 
    // Dynamic rendering
    const infobox = document.getElementById("dynamicInfobox");
 
    for (const [key, value] of Object.entries(infoboxData)) {
      if (value) { // Only include rows where value is not empty
        const row = document.createElement("tr");
        const cellKey = document.createElement("td");
        const cellValue = document.createElement("td");
        cellKey.textContent = key;
        cellValue.textContent = value;
        row.appendChild(cellKey);
        row.appendChild(cellValue);
        infobox.appendChild(row);
      }
    }
  </script>
</body>
</html>

Latest revision as of 18:48, 6 December 2024

File Summary
DescriptionThis file has no description. Please provide one.
SourceThis file is lacking source information. Please provide one.
AuthorThis file is lacking author information. Please provide one.